結果

問題 No.70 睡眠の重要性!
ユーザー mitsuomitsuo
提出日時 2016-05-04 13:28:16
言語 Java21
(openjdk 21)
結果
RE  
実行時間 -
コード長 943 bytes
コンパイル時間 2,580 ms
コンパイル使用メモリ 79,620 KB
実行使用メモリ 41,992 KB
最終ジャッジ日時 2024-04-15 11:16:47
合計ジャッジ時間 3,789 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

import java.time.LocalDateTime;
import java.time.temporal.ChronoUnit;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String[] input = new String[sc.nextInt()];
		int i = 0;
		while (sc.hasNext()) {
			input[i] = sc.nextLine();
			i++;
		}

		System.out.println(solve(input));

		sc.close();
	}

	public static long solve(String[] in) {

		long ans = 0;
		for (int i = 0; i < in.length; i++) {
			String[] s = in[i].split(" ");
			int sh = Integer.valueOf(s[0].split(":")[0]);
			int sm = Integer.valueOf(s[0].split(":")[1]);
			int eh = Integer.valueOf(s[1].split(":")[0]);
			int em = Integer.valueOf(s[1].split(":")[1]);
			LocalDateTime start = LocalDateTime.of(2016, 1, 1, sh, sm, 0, 0);
			LocalDateTime end = LocalDateTime.of(2016, 1, 2, eh, em, 0, 0);
			long d = ChronoUnit.MINUTES.between(start, end);
			ans += d % (60 * 24);
		}
		return ans;
	}
}
0