結果
| 問題 |
No.70 睡眠の重要性!
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2014-11-30 17:51:12 |
| 言語 | Java (openjdk 23) |
| 結果 |
AC
|
| 実行時間 | 137 ms / 5,000 ms |
| コード長 | 630 bytes |
| コンパイル時間 | 3,301 ms |
| コンパイル使用メモリ | 84,768 KB |
| 実行使用メモリ | 42,496 KB |
| 最終ジャッジ日時 | 2024-06-11 07:26:25 |
| 合計ジャッジ時間 | 4,643 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 6 |
ソースコード
import java.util.Scanner;
public class Main70 {
public static void main(String[] args) {
Main70 p = new Main70();
}
public Main70() {
solve();
}
public void solve() {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int total = 0;
for(int i=0;i<n;i++){
String[] s = (sc.next()+":" + sc.next()).split(":");
int st = Integer.parseInt(s[0])*60 + Integer.parseInt(s[1]);
int en = Integer.parseInt(s[2])*60 + Integer.parseInt(s[3]);
if(st>en)
total += (24*60 - st) + en;
else
total += (en-st);
}
System.out.println(total);
}
}