結果

問題 No.70 睡眠の重要性!
コンテスト
ユーザー SSRS
提出日時 2020-07-18 20:25:57
言語 C++14
(gcc 15.2.0 + boost 1.89.0)
コンパイル:
g++-15 -O2 -lm -std=c++14 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 1 ms / 5,000 ms
コード長 381 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,012 ms
コンパイル使用メモリ 179,564 KB
実行使用メモリ 7,976 KB
最終ジャッジ日時 2026-05-24 23:45:34
合計ジャッジ時間 2,075 ms
ジャッジサーバーID
(参考情報)
judge1_1 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 6
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#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;
}
0