結果

問題 No.70 睡眠の重要性!
ユーザー リチウムリチウム
提出日時 2014-11-18 23:43:08
言語 Java19
(openjdk 21)
結果
AC  
実行時間 124 ms / 5,000 ms
コード長 463 bytes
コンパイル時間 3,396 ms
コンパイル使用メモリ 72,524 KB
実行使用メモリ 56,068 KB
最終ジャッジ日時 2023-08-30 21:41:30
合計ジャッジ時間 4,791 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 120 ms
56,068 KB
testcase_01 AC 121 ms
55,784 KB
testcase_02 AC 120 ms
56,064 KB
testcase_03 AC 124 ms
55,380 KB
testcase_04 AC 124 ms
54,336 KB
testcase_05 AC 122 ms
56,024 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

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 S=sc.next();
			String t[]=S.split(":");
			S=sc.next();
			String u[]=S.split(":");
			int k=Integer.valueOf(u[0])*60+Integer.valueOf(u[1])-Integer.valueOf(t[0])*60-Integer.valueOf(t[1]);
			if(k<0)k=1440+k;
			ans+=k;
		}
		System.out.println(ans);
	}}
0