結果

問題 No.70 睡眠の重要性!
ユーザー YukimotoPGYukimotoPG
提出日時 2019-02-14 22:28:23
言語 Java21
(openjdk 21)
結果
AC  
実行時間 130 ms / 5,000 ms
コード長 480 bytes
コンパイル時間 2,073 ms
コンパイル使用メモリ 71,896 KB
実行使用メモリ 57,988 KB
最終ジャッジ日時 2023-10-11 12:46:09
合計ジャッジ時間 3,423 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 127 ms
55,956 KB
testcase_01 AC 125 ms
55,852 KB
testcase_02 AC 126 ms
55,660 KB
testcase_03 AC 130 ms
56,296 KB
testcase_04 AC 130 ms
57,988 KB
testcase_05 AC 125 ms
55,624 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

class Main {
	static Scanner sc = new Scanner(System.in);
	public static void main(String[] args) {
		
		int n = sc.nextInt();
		int sum = 0;
		for (int i=0; i<n; i++) {
			String[] a = sc.next().split(":",0);
			String[] b = sc.next().split(":",0);
			int t1 = Integer.parseInt(a[0])*60 + Integer.parseInt(a[1]);
			int t2 = Integer.parseInt(b[0])*60 + Integer.parseInt(b[1]);
			int t = (t2-t1+1440)%1440;
			sum += t;
		}
		System.out.println(sum);
		
	}
}
0