結果
問題 | No.70 睡眠の重要性! |
ユーザー |
![]() |
提出日時 | 2017-10-21 09:49:40 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 164 ms / 5,000 ms |
コード長 | 557 bytes |
コンパイル時間 | 2,329 ms |
コンパイル使用メモリ | 76,168 KB |
実行使用メモリ | 55,252 KB |
最終ジャッジ日時 | 2024-11-21 12:26:56 |
合計ジャッジ時間 | 3,902 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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]; if(st > en) en += 24 * 60; ans += en - st; } System.out.println(ans); } }