結果
| 問題 |
No.70 睡眠の重要性!
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-12-05 23:44:24 |
| 言語 | C90 (gcc 12.3.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 5,000 ms |
| コード長 | 266 bytes |
| コンパイル時間 | 377 ms |
| コンパイル使用メモリ | 20,608 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-27 21:42:17 |
| 合計ジャッジ時間 | 585 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / 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",&hs,&ms,&hf,&mf);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ソースコード
#include<stdio.h>
#include<string.h>
int main(void){
int n,i,hs,ms,hf,mf,r = 0;
scanf("%d",&n);
for(i = 1;i <= n;i++){
scanf("%d:%d %d:%d",&hs,&ms,&hf,&mf);
ms+=(hs*60);
mf+=(hf*60);
if(mf < ms){mf+=1440;}
r+=(mf-ms);
}
printf("%d\n",r);
return 0;
}