結果
| 問題 | No.70 睡眠の重要性! | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2022-09-26 14:11:23 | 
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 2 ms / 5,000 ms | 
| コード長 | 488 bytes | 
| コンパイル時間 | 1,896 ms | 
| コンパイル使用メモリ | 192,360 KB | 
| 最終ジャッジ日時 | 2025-02-07 16:03:21 | 
| ジャッジサーバーID (参考情報) | judge3 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 6 | 
ソースコード
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (n); i++)
using namespace std;
typedef long long ll;
int main(){
    cin.tie(0);
    ios::sync_with_stdio(0);
    
    int ans = 0;
    int N; cin >> N;
    auto f = [&]() {
        int h,m; char c; cin >> h >> c >> m;
        return h * 60 + m;
    };
    rep(i,N) {
        int S = f(), T = f();
        if(S < T)
            ans += T - S;
        else 
            ans += 24 * 60 + (T - S);
    }
    cout << ans << endl;
}
            
            
            
        