結果

問題 No.70 睡眠の重要性!
ユーザー ohagi_1182ohagi_1182
提出日時 2017-10-21 09:52:48
言語 Java21
(openjdk 21)
結果
AC  
実行時間 171 ms / 5,000 ms
コード長 553 bytes
コンパイル時間 2,110 ms
コンパイル使用メモリ 76,576 KB
実行使用メモリ 55,172 KB
最終ジャッジ日時 2024-05-01 09:11:28
合計ジャッジ時間 3,675 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 153 ms
55,060 KB
testcase_01 AC 156 ms
55,008 KB
testcase_02 AC 171 ms
54,900 KB
testcase_03 AC 161 ms
55,128 KB
testcase_04 AC 167 ms
55,020 KB
testcase_05 AC 156 ms
55,172 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int ans = 0;
		for(int i = 0 ; i < n ; i++) {
			String[] temp = (sc.next() + ":" + sc.next()).split("[\\:]");
			int[] time = {Integer.valueOf(temp[0]), Integer.valueOf(temp[1])
					    , Integer.valueOf(temp[2]), Integer.valueOf(temp[3])};
			int st = time[0] * 60 + time[1];
			int en = (time[2] * 60 + time[3]) + 24 * 60;
			ans += (en - st) % (24 * 60);
		}
		System.out.println(ans);
 	}
}

0