結果
| 問題 |
No.70 睡眠の重要性!
|
| コンテスト | |
| ユーザー |
ohagi_1182
|
| 提出日時 | 2017-10-21 09:52:48 |
| 言語 | Java (openjdk 23) |
| 結果 |
AC
|
| 実行時間 | 163 ms / 5,000 ms |
| コード長 | 553 bytes |
| コンパイル時間 | 2,617 ms |
| コンパイル使用メモリ | 86,292 KB |
| 実行使用メモリ | 55,216 KB |
| 最終ジャッジ日時 | 2024-11-21 12:27:00 |
| 合計ジャッジ時間 | 3,845 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 6 |
ソースコード
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int ans = 0;
for(int i = 0 ; i < n ; i++) {
String[] temp = (sc.next() + ":" + sc.next()).split("[\\:]");
int[] time = {Integer.valueOf(temp[0]), Integer.valueOf(temp[1])
, Integer.valueOf(temp[2]), Integer.valueOf(temp[3])};
int st = time[0] * 60 + time[1];
int en = (time[2] * 60 + time[3]) + 24 * 60;
ans += (en - st) % (24 * 60);
}
System.out.println(ans);
}
}
ohagi_1182