結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,352 KB
testcase_01 AC 1 ms
4,348 KB
testcase_02 AC 1 ms
4,352 KB
testcase_03 AC 1 ms
4,352 KB
testcase_04 AC 2 ms
4,352 KB
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;

    return 0;
}
0