結果

問題 No.70 睡眠の重要性!
ユーザー hiro1729hiro1729
提出日時 2023-11-25 08:29:57
言語 C++23
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 300 bytes
コンパイル時間 2,721 ms
コンパイル使用メモリ 243,732 KB
実行使用メモリ 6,676 KB
最終ジャッジ日時 2023-11-25 08:30:01
合計ジャッジ時間 3,343 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int main() {
	int N;
	cin >> N;
	int ans = 0;
	while (N--) {
		int sh, sm, eh, em;
		char _1, _2;
		cin >> sh >> _1 >> sm >> eh >> _2 >> em;
		int t = eh * 60 + em - (sh * 60 + sm);
		if (t < 0) {
			t += 1440;
		}
		ans += t;
	}
	cout << ans << '\n';
}
0