結果
| 問題 | No.70 睡眠の重要性! | 
| コンテスト | |
| ユーザー |  Irmystp | 
| 提出日時 | 2014-12-03 02:58:23 | 
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) | 
| 結果 | 
                                WA
                                 
                            (最新) 
                                AC
                                 
                            (最初) | 
| 実行時間 | - | 
| コード長 | 274 bytes | 
| コンパイル時間 | 115 ms | 
| コンパイル使用メモリ | 22,656 KB | 
| 実行使用メモリ | 5,376 KB | 
| 最終ジャッジ日時 | 2024-06-11 14:39:50 | 
| 合計ジャッジ時間 | 656 ms | 
| ジャッジサーバーID (参考情報) | judge1 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 5 WA * 1 | 
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:7:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    7 |     for(scanf("%d", &N); N--;){
      |         ~~~~~^~~~~~~~~~
main.cpp:8:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    8 |         scanf("%d:%d %d:%d", &h1, &m1, &h2, &m2);
      |         ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            
            ソースコード
#include <cstdio>
using namespace std;
int main(){
    int N, h1, m1, h2, m2, s;
    s = 0;
    for(scanf("%d", &N); N--;){
        scanf("%d:%d %d:%d", &h1, &m1, &h2, &m2);
        s += (h2-h1+24)%24*60 + (m2-m1);
    }
    printf("%d\n", s);
    return 0;
}
            
            
            
        