結果

問題 No.70 睡眠の重要性!
ユーザー yagi2yagi2
提出日時 2017-04-25 16:22:07
言語 Java21
(openjdk 21)
結果
AC  
実行時間 114 ms / 5,000 ms
コード長 657 bytes
コンパイル時間 1,977 ms
コンパイル使用メモリ 72,684 KB
実行使用メモリ 56,336 KB
最終ジャッジ日時 2023-10-11 09:39:25
合計ジャッジ時間 3,017 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 106 ms
54,232 KB
testcase_01 AC 109 ms
56,120 KB
testcase_02 AC 106 ms
55,852 KB
testcase_03 AC 113 ms
56,336 KB
testcase_04 AC 114 ms
55,832 KB
testcase_05 AC 103 ms
55,844 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = Integer.parseInt(sc.next());
        int sum = 0;
        for (int i = 0; i < N; i++) {
            String G = sc.next();
            String W = sc.next();

            int Gh = Integer.parseInt(G.split(":")[0]);
            int Gm = Integer.parseInt(G.split(":")[1]);
            int Wh = Integer.parseInt(W.split(":")[0]);
            int Wm = Integer.parseInt(W.split(":")[1]);

            sum += ((Wh - Gh) * 60 + (Wm - Gm) + 24 * 60) % (24 * 60);
        }
        System.out.println(sum);
    }
}
0