結果

問題 No.70 睡眠の重要性!
ユーザー ohagi_1182ohagi_1182
提出日時 2017-10-20 22:20:29
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 462 bytes
コンパイル時間 1,918 ms
コンパイル使用メモリ 77,068 KB
実行使用メモリ 54,944 KB
最終ジャッジ日時 2024-05-01 07:58:36
合計ジャッジ時間 3,251 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 135 ms
54,944 KB
testcase_01 AC 119 ms
54,384 KB
testcase_02 AC 133 ms
54,496 KB
testcase_03 AC 135 ms
53,600 KB
testcase_04 AC 139 ms
54,924 KB
testcase_05 WA -
権限があれば一括ダウンロードができます

ソースコード

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[] time = (sc.next() + ":" + sc.next()).split(":");
			int h = (Integer.valueOf(time[2]) + 24 - Integer.valueOf(time[0])) % 24;
			int m = Integer.valueOf(time[3]) - Integer.valueOf(time[1]);
			ans += h * 60 + m;
		}
		System.out.println(ans);
 	}
}

0