結果

問題 No.70 睡眠の重要性!
ユーザー ohagi_1182ohagi_1182
提出日時 2017-10-20 22:32:15
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 526 bytes
コンパイル時間 2,363 ms
コンパイル使用メモリ 76,676 KB
実行使用メモリ 55,400 KB
最終ジャッジ日時 2024-05-01 07:59:00
合計ジャッジ時間 3,984 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 164 ms
42,476 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[] time = (sc.next() + ":" + sc.next()).split(":");
			int st = Integer.valueOf(time[2]) * 60 + Integer.valueOf(time[3]);
			int en = Integer.valueOf(time[0]) * 60 + Integer.valueOf(time[1]);
			if(en < st) {
				ans += (24 * 60 - st) + en;
			} else {
				ans += en - st;
			}
		}
		System.out.println(ans);
 	}
}

0