結果

問題 No.70 睡眠の重要性!
ユーザー Tsukasa_Type
提出日時 2018-02-11 02:11:55
言語 Java
(openjdk 23)
結果
AC  
実行時間 142 ms / 5,000 ms
コード長 506 bytes
コンパイル時間 2,283 ms
コンパイル使用メモリ 74,348 KB
実行使用メモリ 41,552 KB
最終ジャッジ日時 2024-11-06 22:46:38
合計ジャッジ時間 3,705 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 6
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
	static Scanner sc = new Scanner(System.in);
	public static void main(String[] args) {
		int n = sc.nextInt();
		int total = 0;
		
		for (int i=0; i<n; i++) {
			String[] sleep = sc.next().split(":");
			String[] wake = sc.next().split(":");
			int M = Integer.parseInt(sleep[0])*60 + Integer.parseInt(sleep[1]);
			int m = Integer.parseInt(wake[0])*60 + Integer.parseInt(wake[1]);
			int t = (m-M+1440)%1440;
			total += t;
		}
		
		System.out.println(total);
	}
}
0