結果

問題 No.70 睡眠の重要性!
ユーザー spaciaspacia
提出日時 2016-01-04 12:40:52
言語 Java21
(openjdk 21)
結果
AC  
実行時間 59 ms / 5,000 ms
コード長 788 bytes
コンパイル時間 2,364 ms
コンパイル使用メモリ 74,988 KB
実行使用メモリ 53,448 KB
最終ジャッジ日時 2023-10-19 15:01:39
合計ジャッジ時間 3,282 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 56 ms
53,432 KB
testcase_01 AC 59 ms
52,360 KB
testcase_02 AC 58 ms
52,556 KB
testcase_03 AC 58 ms
53,436 KB
testcase_04 AC 58 ms
53,448 KB
testcase_05 AC 57 ms
52,344 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.*;
import java.util.*;
import java.math.*;

class Main {
	
	public static void out (Object o) {
		System.out.println(o);
	}
	
	public static void main (String[] args) throws IOException {
		BufferedReader br = 
			new BufferedReader(new InputStreamReader(System.in));
		
		int n = Integer.parseInt(br.readLine());
		int ans = 0;
		
		for (int i = 0; i < n; i++) {
			String[] line = br.readLine().split(" ");
			String[] time1 = line[0].split(":");
			String[] time2 = line[1].split(":");
			int h1 = Integer.parseInt(time1[0]);
			int m1 = Integer.parseInt(time1[1]);
			int h2 = Integer.parseInt(time2[0]);
			int m2 = Integer.parseInt(time2[1]);
			int t1 = h1 * 60 + m1;
			int t2 = h2 * 60 + m2;
			ans += t1 <= t2 ? t2 - t1 : 1440 - (t1 - t2);
		}
		
		out(ans);
	}
}
0