結果
| 問題 | No.70 睡眠の重要性! |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-10-31 22:37:30 |
| 言語 | Java (openjdk 25.0.2) |
| 結果 |
AC
|
| 実行時間 | 56 ms / 5,000 ms |
| コード長 | 855 bytes |
| 記録 | |
| コンパイル時間 | 2,537 ms |
| コンパイル使用メモリ | 82,284 KB |
| 実行使用メモリ | 41,800 KB |
| 最終ジャッジ日時 | 2026-05-16 13:31:54 |
| 合計ジャッジ時間 | 3,591 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 6 |
ソースコード
import java.util.Scanner;
public class No70 {
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
int count = s.nextInt();
int minutes = 0;
for (int i = 0; i < count; i++) {
String[] sleep = s.next().split(":");
String[] wakeup = s.next().split(":");
int sleepHour = Integer.parseInt(sleep[0]);
int wakeupHour = Integer.parseInt(wakeup[0]);
int sleepMinute = Integer.parseInt(sleep[1]);
int wakeupMinute = Integer.parseInt(wakeup[1]);
if (sleepHour > wakeupHour || sleepHour == wakeupHour && sleepMinute > wakeupMinute) {
wakeupHour += 24;
}
minutes += (wakeupHour - sleepHour) * 60 + wakeupMinute - sleepMinute;
}
System.out.println(minutes);
}
}