結果
| 問題 |
No.70 睡眠の重要性!
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2014-11-18 23:25:18 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 5,000 ms |
| コード長 | 212 bytes |
| コンパイル時間 | 273 ms |
| コンパイル使用メモリ | 27,136 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2025-01-02 18:54:19 |
| 合計ジャッジ時間 | 867 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 6 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:4:18: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
4 | for(scanf("%d",&n);n--;){
| ~~~~~^~~~~~~~~
main.cpp:5:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
5 | scanf("%d:%d%d:%d",&H,&M,&h,&m);
| ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
ソースコード
#include <stdio.h>
int main(){
int n,H,M,h,m,r=0;
for(scanf("%d",&n);n--;){
scanf("%d:%d%d:%d",&H,&M,&h,&m);
M+=H*60,m+=h*60;
m-=M;
if(m<0)m+=1440;
r+=m;
}
printf("%d\n",r);
return 0;
}