結果
問題 | No.70 睡眠の重要性! |
ユーザー | kano_town |
提出日時 | 2014-11-20 10:50:13 |
言語 | Java19 (openjdk 21) |
結果 |
WA
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 600 bytes |
コンパイル時間 | 3,203 ms |
コンパイル使用メモリ | 71,896 KB |
実行使用メモリ | 56,292 KB |
最終ジャッジ日時 | 2023-08-30 21:54:49 |
合計ジャッジ時間 | 4,534 ms |
ジャッジサーバーID (参考情報) |
judge13 / judge15 |
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 116 ms
55,988 KB |
testcase_01 | AC | 118 ms
56,004 KB |
testcase_02 | AC | 120 ms
55,984 KB |
testcase_03 | AC | 122 ms
55,932 KB |
testcase_04 | AC | 123 ms
56,292 KB |
testcase_05 | WA | - |
ソースコード
import java.util.Scanner; public class Yukicoder70 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); String s; String[] buf, buf2; int h1, m1, h2, m2; int sum = 0; for (int i = 0; i < n; i++) { buf = sc.next().split(":"); h1 = Integer.parseInt(buf[0]); m1 = Integer.parseInt(buf[1]); buf = sc.next().split(":"); h2 = Integer.parseInt(buf[0]); m2 = Integer.parseInt(buf[1]); sum += h1 > h2 ? (h2 - h1 + 24) * 60 : (h2 - h1) * 60; sum += m2 - m1; } System.out.println(sum); } }