結果
| 問題 |
No.70 睡眠の重要性!
|
| コンテスト | |
| ユーザー |
suppy193
|
| 提出日時 | 2015-05-28 15:04:17 |
| 言語 | C90 (gcc 12.3.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 5,000 ms |
| コード長 | 378 bytes |
| コンパイル時間 | 114 ms |
| コンパイル使用メモリ | 21,120 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-07-06 12:06:52 |
| 合計ジャッジ時間 | 601 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 6 |
コンパイルメッセージ
main.c: In function ‘main’:
main.c:6:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
6 | scanf("%d", &N);
| ^~~~~~~~~~~~~~~
main.c:8:17: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
8 | scanf("%d:%d%d:%d", &H[i], &M[i], &h[i], &m[i]);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ソースコード
#include <stdio.h>
int main(void) {
int i, N, H[31], M[31], h[31], m[31];
int s, e, t, total = 0;
scanf("%d", &N);
for(i = 1;i <= N;i++){
scanf("%d:%d%d:%d", &H[i], &M[i], &h[i], &m[i]);
}
for(i = 1;i <= N;i++){
s = H[i] * 60 + M[i];
e = h[i] * 60 + m[i];
if(s > e)t = 24 * 60 - s + e;
else t = e - s;
total += t;
}
printf("%d\n", total);
return 0;
}
suppy193