結果
問題 | No.70 睡眠の重要性! |
ユーザー | Himatsubushin |
提出日時 | 2021-07-06 14:29:27 |
言語 | C (gcc 12.3.0) |
結果 |
AC
|
実行時間 | 1 ms / 5,000 ms |
コード長 | 416 bytes |
コンパイル時間 | 103 ms |
コンパイル使用メモリ | 27,772 KB |
実行使用メモリ | 4,384 KB |
最終ジャッジ日時 | 2023-09-14 04:22:27 |
合計ジャッジ時間 | 670 ms |
ジャッジサーバーID (参考情報) |
judge14 / judge13 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 1 ms
4,376 KB |
testcase_01 | AC | 1 ms
4,380 KB |
testcase_02 | AC | 1 ms
4,376 KB |
testcase_03 | AC | 1 ms
4,384 KB |
testcase_04 | AC | 1 ms
4,380 KB |
testcase_05 | AC | 0 ms
4,380 KB |
ソースコード
#include <stdio.h> #include <stdlib.h> int main(void) { char input[12]; int i, a, b, c, d, n, start, end, sum = 0; scanf("%d", &n); for (i = 0; i < n; i++) { scanf("%d:%d %d:%d", &a, &b, &c, &d); start = a * 60 + b; end = c * 60 + d; if (start > end) { sum += end + 24 * 60 - start; } else { sum += end - start; } } printf("%d\n", sum); return EXIT_SUCCESS; }