結果

問題 No.70 睡眠の重要性!
ユーザー penguinshunyapenguinshunya
提出日時 2019-04-18 10:10:35
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 1,168 bytes
コンパイル時間 2,021 ms
コンパイル使用メモリ 201,412 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-22 07:45:32
合計ジャッジ時間 2,591 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>

#define rep(i, n) for (int i = 0; i < int(n); i++)
#define rrep(i, n) for (int i = int(n) - 1; i >= 0; i--)
#define reps(i, n) for (int i = 1; i <= int(n); i++)
#define rreps(i, n) for (int i = int(n); i >= 1; i--)
#define repi(i, a, b) for (int i = (a); i < int(b); i++)
#define all(a) (a).begin(), (a).end()
#define bit(b) (1ull << (b))
#define uniq(v) (v).erase(unique(all(v)), (v).end())

using namespace std;
using i32 = int;
using i64 = long long;
using f64 = double;
using vi32 = vector<i32>;
using vi64 = vector<i64>;
using vf64 = vector<f64>;
using vstr = vector<string>;

template<typename T, typename S> void amax(T &x, S y) { if (x < y) x = y; }
template<typename T, typename S> void amin(T &x, S y) { if (y < x) x = y; }

int solve() {
  char _;
  int h1, m1, h2, m2;
  cin >> h1 >> _ >> m1 >> h2 >> _ >> m2;
  h2 += 24;
  int a = h1 * 60 + m1;
  int b = h2 * 60 + m2;
  int ans = b - a;
  ans %= 60 * 24;
  return ans;
}

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout << fixed << setprecision(16);
  int n;
  cin >> n;
  int ans = 0;
  rep(_, n) {
    ans += solve();
  }
  cout << ans << endl;
  return 0;
}
0