結果

問題 No.70 睡眠の重要性!
ユーザー rf141rf141
提出日時 2015-12-20 09:51:50
言語 Java21
(openjdk 21)
結果
AC  
実行時間 140 ms / 5,000 ms
コード長 566 bytes
コンパイル時間 2,042 ms
コンパイル使用メモリ 75,028 KB
実行使用メモリ 57,664 KB
最終ジャッジ日時 2023-10-17 14:06:21
合計ジャッジ時間 3,483 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 128 ms
57,440 KB
testcase_01 AC 134 ms
57,664 KB
testcase_02 AC 132 ms
55,640 KB
testcase_03 AC 138 ms
57,664 KB
testcase_04 AC 140 ms
57,656 KB
testcase_05 AC 130 ms
57,660 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
public class Main {
    public static void main(String... args) {
        Scanner scan=new Scanner(System.in);
        int n=scan.nextInt();
        int result=0;
        for(int i=0;i<n;i++){
            String S=scan.next();
            String t[]=S.split(":");
            S=scan.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;
            result+=k;
        }
        System.out.println(result);
    }
}
0