結果

問題 No.70 睡眠の重要性!
ユーザー mits58mits58
提出日時 2016-07-29 23:15:38
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 615 bytes
コンパイル時間 2,397 ms
コンパイル使用メモリ 74,744 KB
実行使用メモリ 56,052 KB
最終ジャッジ日時 2024-04-24 12:22:59
合計ジャッジ時間 3,334 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 110 ms
52,988 KB
testcase_01 AC 112 ms
54,144 KB
testcase_02 AC 99 ms
52,692 KB
testcase_03 AC 127 ms
54,064 KB
testcase_04 AC 131 ms
53,880 KB
testcase_05 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

class Main{
	public static void main(String[] args){
		Scanner sc=new Scanner(System.in);
		while(sc.hasNext()){
			int n=sc.nextInt();
			int sum=0;
			for(int i=0;i<n;i++){
				String[] s1=(sc.next()).split(":");
				String[] s2=(sc.next()).split(":");
				int t1=24*60-Integer.valueOf(s1[0])*60-Integer.valueOf(s1[1]);
				int t2=Integer.parseInt(s2[0])*60+Integer.valueOf(s2[1]);
				if(t1>12*60) t1=-Integer.valueOf(s1[0])*60-Integer.valueOf(s1[1]);
				if(t2>12*60) t2=Integer.valueOf(s2[0])*60+Integer.valueOf(s2[1])-24*60;
				sum+=t1+t2;
			}
			System.out.println(sum);
		}
	}
}
0