結果
| 問題 | No.70 睡眠の重要性! | 
| コンテスト | |
| ユーザー |  SSRS | 
| 提出日時 | 2020-07-18 20:25:57 | 
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 2 ms / 5,000 ms | 
| コード長 | 381 bytes | 
| コンパイル時間 | 1,624 ms | 
| コンパイル使用メモリ | 166,120 KB | 
| 実行使用メモリ | 6,820 KB | 
| 最終ジャッジ日時 | 2024-12-14 05:56:05 | 
| 合計ジャッジ時間 | 2,193 ms | 
| ジャッジサーバーID (参考情報) | judge4 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 6 | 
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main(){
  int N;
  cin >> N;
  int ans = 0;
  for (int i = 0; i < N; i++){
    int H1, M1, h1, m1;
    char c1, c2;
    cin >> H1 >> c1 >> M1 >> h1 >> c2 >> m1;
    int t1 = H1 * 60 + M1;
    int t2 = h1 * 60 + m1;
    if (t1 < t2){
      ans += t2 - t1;
    } else {
      ans += t2 - t1 + 1440;
    }
  }
  cout << ans << endl;
}
            
            
            
        