結果

問題 No.70 睡眠の重要性!
ユーザー ohagi_1182
提出日時 2017-10-20 22:32:15
言語 Java
(openjdk 23)
結果
WA  
実行時間 -
コード長 526 bytes
コンパイル時間 2,606 ms
コンパイル使用メモリ 81,616 KB
実行使用メモリ 55,200 KB
最終ジャッジ日時 2024-11-21 10:51:33
合計ジャッジ時間 4,281 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 1 WA * 5
権限があれば一括ダウンロードができます

ソースコード

diff #

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[] time = (sc.next() + ":" + sc.next()).split(":");
			int st = Integer.valueOf(time[2]) * 60 + Integer.valueOf(time[3]);
			int en = Integer.valueOf(time[0]) * 60 + Integer.valueOf(time[1]);
			if(en < st) {
				ans += (24 * 60 - st) + en;
			} else {
				ans += en - st;
			}
		}
		System.out.println(ans);
 	}
}

0