結果

問題 No.70 睡眠の重要性!
ユーザー 37zigen37zigen
提出日時 2016-04-01 11:27:16
言語 Java21
(openjdk 21)
結果
AC  
実行時間 128 ms / 5,000 ms
コード長 544 bytes
コンパイル時間 1,909 ms
コンパイル使用メモリ 74,808 KB
実行使用メモリ 54,124 KB
最終ジャッジ日時 2024-04-10 07:02:52
合計ジャッジ時間 3,188 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 108 ms
53,032 KB
testcase_01 AC 110 ms
52,992 KB
testcase_02 AC 110 ms
52,932 KB
testcase_03 AC 125 ms
54,000 KB
testcase_04 AC 128 ms
54,124 KB
testcase_05 AC 117 ms
54,052 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package yukicoder070;
import java.util.Scanner;
public class Main {
	public static void main(String[] args){
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		int sum=0;
		for(int i=0;i<n;i++){
			String str1=sc.next();
			String str2=sc.next();
			String[] Str1=str1.split(":");
			String[] Str2=str2.split(":");
			int t1=Integer.parseInt(Str1[0])*60+Integer.parseInt(Str1[1]);
			int t2=Integer.parseInt(Str2[0])*60+Integer.parseInt(Str2[1]);
			
			int t=t2-t1;
			if(t<0)t+=24*60;
			sum+=t;
		}
		System.out.println(sum);
	}
}
0