結果
| 問題 |
No.70 睡眠の重要性!
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2015-09-23 00:24:47 |
| 言語 | Java (openjdk 23) |
| 結果 |
AC
|
| 実行時間 | 205 ms / 5,000 ms |
| コード長 | 912 bytes |
| コンパイル時間 | 3,044 ms |
| コンパイル使用メモリ | 80,828 KB |
| 実行使用メモリ | 44,028 KB |
| 最終ジャッジ日時 | 2024-07-19 08:44:56 |
| 合計ジャッジ時間 | 5,138 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 6 |
ソースコード
import java.text.SimpleDateFormat;
import java.util.Scanner;
public class Main_yukicoder70 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
SimpleDateFormat sdf = new SimpleDateFormat("h:m");
int n = sc.nextInt();
int ret = 0;
for (int i = 0; i < n; i++) {
try {
String ss = sc.next();
String ee = sc.next();
// System.err.println(ss);
// System.err.println(ee);
// System.err.println(sdf.parse(ss));
// System.err.println(sdf.parse(ee));
long s = sdf.parse(ss).getTime();
long e = sdf.parse(ee).getTime();
// System.err.println(s);
// System.err.println(e);
ret += (Math.abs((e - s + 3600 * 24 * 1000)) % (3600 * 24 * 1000)) / 60000;
} catch (Exception exc) {
// throw new RuntimeException();
sc.close();
return;
}
}
System.out.println(ret);
sc.close();
}
}