結果

問題 No.70 睡眠の重要性!
ユーザー ry0u_ydry0u_yd
提出日時 2015-12-19 17:07:26
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 662 bytes
コンパイル時間 538 ms
コンパイル使用メモリ 61,204 KB
実行使用メモリ 4,368 KB
最終ジャッジ日時 2023-10-14 22:30:04
合計ジャッジ時間 1,041 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,352 KB
testcase_01 AC 1 ms
4,352 KB
testcase_02 AC 1 ms
4,352 KB
testcase_03 AC 1 ms
4,352 KB
testcase_04 AC 2 ms
4,352 KB
testcase_05 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cstring>

#define REP(i,k,n) for(int i=k;i<n;i++)
#define rep(i,n) for(int i=0;i<n;i++)

using namespace std;

int main()
{
	int n;
	cin >> n;

	int ans = 0;

	rep(i,n)
	{
		int H,M,h,m;
		char c;

		cin >> H >> c >> M >> h >> c >> m;

		int s = H*60 + M;
		int t = h*60 + m;
		int d[24*60];
		memset(d, 0, sizeof(d));

		if(H > h) {
			rep(j, t) {
				d[j]++;
			}

			REP(j, s, 24 * 60) {
				d[j]++;
			}
		} else {
			REP(j, s, t) {
				d[j]++;
			}
		}

		int cnt = 0;
		rep(j, 24*60) {
			if(d[j] > 0) cnt++;
		}

		ans += cnt;
	}

	cout << ans << endl;
	
	return 0;
}
0