题目链接:http://codeforces.com/problemset/problem/16/D
水题呵呵。。
#include<stdio.h>
#include<iostream>
#include<string.h>
#include<set>
#include<vector>
#include<map>
#include<math.h>
#include<queue>
#include<string>
#include<stdlib.h>
#include<algorithm>
using namespace std;
#define N 110
#define ll int
struct node{
int h,m;
int hehe;
}a[N];
int n;
char s[10000];
int main(){
int i, j;
while(~scanf("%d",&n)){
getchar();
for(i = 1; i <= n; i++){
gets(s);
a[i].h = (s[1]-'0')*10+s[2]-'0';
a[i].m = (s[4]-'0')*10+s[5]-'0';
if(a[i].h==12)a[i].h=0;
if(s[7]=='p') {
a[i].h+=12;
}
a[i].hehe = a[i].m + a[i].h*60;
}
int ans = 1, x = a[1].hehe;
ll siz = 1;
for(i = 2; i <= n; i++) {
if(a[i].hehe<x)siz = 1, ans++;
else if(a[i].hehe==x)siz++;
else siz = 1;
if(siz>10){siz = 1;ans++;}
x = a[i].hehe;
}
printf("%d\n",ans);
}
return 0;
}