結果
問題 | No.70 睡眠の重要性! |
ユーザー |
![]() |
提出日時 | 2015-05-02 14:54:01 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 320 bytes |
コンパイル時間 | 1,036 ms |
コンパイル使用メモリ | 157,004 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-05 17:28:40 |
合計ジャッジ時間 | 1,446 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 6 |
コンパイルメッセージ
main.cpp: In function ‘int gettime()’: main.cpp:5:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 5 | scanf("%d:%d",&a,&b); | ~~~~~^~~~~~~~~~~~~~~ main.cpp: In function ‘int main()’: main.cpp:10:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 10 | scanf("%d",&N); | ~~~~~^~~~~~~~~
ソースコード
#include<bits/stdc++.h> using namespace std; int gettime(){ int a,b; scanf("%d:%d",&a,&b); return a*60+b; } int main(){ int N,sum=0; scanf("%d",&N); for(int i=0;i<N;i++){ int a,b; a=gettime(); b=gettime(); sum+=(b-a+24*60)%(24*60); } printf("%d\n",sum); }