結果

問題 No.70 睡眠の重要性!
ユーザー bal4ubal4u
提出日時 2019-04-08 21:38:53
言語 C
(gcc 12.3.0)
結果
AC  
実行時間 1 ms / 5,000 ms
コード長 526 bytes
コンパイル時間 222 ms
コンパイル使用メモリ 28,812 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-14 15:44:05
合計ジャッジ時間 746 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

// yukicoder: No.70 睡眠の重要性
// 2019.4.8 bal4u

#include <stdio.h>
#include <ctype.h>

#define gc() getchar()
int in()    // 非負整数の入力
{
	int n = 0, c = gc();
	while (isspace(c)) c = gc();
	do n = 10 * n + (c & 0xf), c = gc(); while (isdigit(c));
	return n;
}

int main()
{
	int N, a, b, c, d, t1, t2, ans;
	
	ans = 0;
	N = in(); while (N--) {
		a = in(), b = in(), c = in(), d = in();
		t1 = a * 60 + b, t2 = c * 60 + d;
		if (t1 > t2) t2 += 1440;
		ans += t2 - t1;
	}
	printf("%d\n", ans);
	return 0;
}
0