結果

問題 No.70 睡眠の重要性!
ユーザー hryshtkhryshtk
提出日時 2015-08-20 22:25:57
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 538 bytes
コンパイル時間 1,157 ms
コンパイル使用メモリ 144,452 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-25 13:59:30
合計ジャッジ時間 1,670 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 1 ms
4,384 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 1 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

// 想定解
#include <bits/stdc++.h>
using namespace std;
void rc(int v,int mn,int mx){if(v<mn||mx<v){cerr<<"error"<<endl;exit(1);}}
#define REP(i, n)           for(int(i)=0;(i)<(n);++(i))

const int MAXN = 30;

int main(){
    int N;
    cin >> N; rc(N, 1, MAXN);
    int result = 0;
    REP(i,N){
        int h1,m1,h2,m2; char d;
        cin >> h1 >> d >> m1 >> h2 >> d >> m2;
        rc(h1,0,23); rc(m1,0,59); rc(h2,0,23); rc(m2,0,59);
        result += ((24+h2-h1)*60+m2-m1)%(24*60);
    }
    cout << result << endl;
    return 0;
}
0