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