結果

問題 No.70 睡眠の重要性!
ユーザー scachescache
提出日時 2014-11-30 17:51:12
言語 Java19
(openjdk 21)
結果
AC  
実行時間 161 ms / 5,000 ms
コード長 630 bytes
コンパイル時間 3,544 ms
コンパイル使用メモリ 73,788 KB
実行使用メモリ 57,344 KB
最終ジャッジ日時 2023-09-02 00:56:42
合計ジャッジ時間 5,333 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 156 ms
57,280 KB
testcase_01 AC 155 ms
57,120 KB
testcase_02 AC 155 ms
57,344 KB
testcase_03 AC 161 ms
56,988 KB
testcase_04 AC 160 ms
56,884 KB
testcase_05 AC 156 ms
57,324 KB
権限があれば一括ダウンロードができます

ソースコード

diff #


import java.util.Scanner;

public class Main70 {
	public static void main(String[] args) {
		Main70 p = new Main70();
	}

	public Main70() {
		solve();
	}

	public void solve() {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		
		int total = 0;
		for(int i=0;i<n;i++){
			String[] s = (sc.next()+":" + sc.next()).split(":");
			int st = Integer.parseInt(s[0])*60 + Integer.parseInt(s[1]);
			int en = Integer.parseInt(s[2])*60 + Integer.parseInt(s[3]);
			
			if(st>en)
				total += (24*60 - st) + en;
			else
				total += (en-st);
		}
		
		System.out.println(total);
		
	}

}
0