結果
問題 | No.70 睡眠の重要性! |
ユーザー |
![]() |
提出日時 | 2017-08-19 17:50:39 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 534 bytes |
コンパイル時間 | 446 ms |
コンパイル使用メモリ | 54,388 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-10-14 15:47:34 |
合計ジャッジ時間 | 944 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 6 |
ソースコード
#include <iostream>using namespace std;int n, H, M, h, m, ans;char d;int main() {cin >> n;for (int i = 0; i < n; i++) {cin >> H >> d >> M >> h >> d >> m;if (H == h) {if (M <= m) {ans += m - M;} else {h += 24;ans += (h - H - 1) * 60;ans += (60 - M) + m;}} else if (H > h) {h += 24;ans += (h - H - 1) * 60;ans += (60 - M) + m;} else {ans += (h - H - 1) * 60;ans += (60 - M) + m;}}cout << ans << endl;}