結果

問題 No.70 睡眠の重要性!
ユーザー pyonthpyonth
提出日時 2020-09-18 04:13:31
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 866 bytes
コンパイル時間 1,985 ms
コンパイル使用メモリ 199,220 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-04 08:24:14
合計ジャッジ時間 2,591 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#define repl(i, l, r) for (ll i = (l); i < (r); i++)
#define rep(i, n) repl(i, 0, n)
#define CST(x) cout << fixed << setprecision(x)
using ll = long long;
const ll MOD = 1000000007;
const int inf = 1e9 + 10;
const ll INF = 4e18 + 10;
const int dx[9] = {1, 0, -1, 0, 1, -1, -1, 1, 0};
const int dy[9] = {0, 1, 0, -1, 1, 1, -1, -1, 0};
int main() {
	cin.tie(0);
	cout.tie(0);
	ios::sync_with_stdio(false);

	int n;
	cin >> n;
	int ans = 0;
	rep(i, n) {
		string s[2];
		cin >> s[0] >> s[1];
		int S[2];
		rep(i, 2) {
			int a = 0, b = 0;
			bool flag = 0;
			for (auto c : s[i]) {
				if (c == ':') {
					flag = 1;
					continue;
				}
				if (!flag)
					a = a * 10 + c - '0';
				else
					b = b * 10 + c - '0';
			}
			S[i] = a * 60 + b;
		}
		ans += (S[1] + 1440 - S[0]) % 1440;
	}
	cout << ans << endl;

	return 0;
}
0