就就这个蒟蒻
查看原帖
就就这个蒟蒻
349906
封禁用户楼主2021/6/9 21:17
#include<iostream>
#include<cstring>
#include<string>
using namespace std;
int main()
{
	int n;
	int cnt = 0;
	int lastt = -1;
	int ans = 1;
	cin >> n;
	for (int i = 0; i < n ; i++)
	{
		int h, m, t;
		string s, nouse1;
		char nouse2;
		cin >> nouse2 >> h >> nouse2 >> m >> s;
		getline(cin, nouse1);
		//getchar();
		if (s == "a.m.]:")t = h * 60 + m;
		else t = 720 + h * 60 + m;
		if (lastt > t||cnt > 10)
		{
			ans++;
			cnt = 0;
		}
		if (lastt == t)
		{
			cnt++;
		}
		else
		{
			cnt = 0;
		}
		lastt = t;
	}
	cout << ans;
	return 0;
}

第14个点挂了! 救救我吧!!! 代码因该挺好理解的吧......

2021/6/9 21:17
加载中...