結果
| 問題 | No.70 睡眠の重要性! | 
| コンテスト | |
| ユーザー |  spacia | 
| 提出日時 | 2016-01-04 12:40:52 | 
| 言語 | Java (openjdk 23) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 49 ms / 5,000 ms | 
| コード長 | 788 bytes | 
| コンパイル時間 | 2,528 ms | 
| コンパイル使用メモリ | 74,480 KB | 
| 実行使用メモリ | 37,052 KB | 
| 最終ジャッジ日時 | 2024-09-19 11:09:47 | 
| 合計ジャッジ時間 | 2,776 ms | 
| ジャッジサーバーID (参考情報) | judge3 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 6 | 
ソースコード
import java.io.*;
import java.util.*;
import java.math.*;
class Main {
	
	public static void out (Object o) {
		System.out.println(o);
	}
	
	public static void main (String[] args) throws IOException {
		BufferedReader br = 
			new BufferedReader(new InputStreamReader(System.in));
		
		int n = Integer.parseInt(br.readLine());
		int ans = 0;
		
		for (int i = 0; i < n; i++) {
			String[] line = br.readLine().split(" ");
			String[] time1 = line[0].split(":");
			String[] time2 = line[1].split(":");
			int h1 = Integer.parseInt(time1[0]);
			int m1 = Integer.parseInt(time1[1]);
			int h2 = Integer.parseInt(time2[0]);
			int m2 = Integer.parseInt(time2[1]);
			int t1 = h1 * 60 + m1;
			int t2 = h2 * 60 + m2;
			ans += t1 <= t2 ? t2 - t1 : 1440 - (t1 - t2);
		}
		
		out(ans);
	}
}
            
            
            
        