結果

問題 No.70 睡眠の重要性!
ユーザー kanzaki_puyokanzaki_puyo
提出日時 2015-11-14 15:54:46
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 502 bytes
コンパイル時間 405 ms
コンパイル使用メモリ 56,952 KB
実行使用メモリ 4,356 KB
最終ジャッジ日時 2023-10-11 17:43:00
合計ジャッジ時間 992 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<cmath>
#include<cstdio>
#include<string>
using namespace std;

int main()
{
    int h1, m1, h2, m2, n;
    int sleep = 0;

    cin >> n;
    for(int i=0; i<n ;i++){
        scanf("%d:%d %d:%d", &h1, &m1, &h2, &m2);
        if(h1 > h2){
            h1 -= 24;
        }
        if(m2 < m1){
            sleep -= 60;
        }
        sleep += ((60 - m1) + m2)%60;
        sleep += (h2 - h1)*60;
        cout << sleep << endl;
    }
    cout << sleep << endl;

    return 0;
}
0