結果

問題 No.70 睡眠の重要性!
コンテスト
ユーザー kohaku_kohaku
提出日時 2016-11-13 22:28:19
言語 Java
(openjdk 27 + ACL)
コンパイル:
javac -J-Duser.language=en -encoding UTF8 -cp /opt/aclib/ac_library.jar _filename_
実行:
java -ea -Xmx700m -Xss256M -DONLINE_JUDGE=true -cp .:/opt/aclib/ac_library.jar _class_
結果
RE  
実行時間 -
コード長 790 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,343 ms
コンパイル使用メモリ 85,852 KB
実行使用メモリ 45,392 KB
最終ジャッジ日時 2026-09-30 01:38:31
合計ジャッジ時間 2,711 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other RE * 6
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int total =0;
        for(int i=0; i<N; i++){
            String S = sc.nextLine();
            String [] s = S.split(" ");
            String [] arr1 = s[0].split(":");
            String [] arr2 = s[1].split(":");
            int H = Integer.parseInt(arr1[0]);
            int M = Integer.parseInt(arr1[1]);
            int h = Integer.parseInt(arr2[0]);
            int m = Integer.parseInt(arr2[1]);
            int temp = h-H;
            if(temp<0){
                temp = temp +24;
            }
            int z = temp*60+(m-M);
            total = total + z;
        }
        System.out.println(total);
    }
}
0