結果

問題 No.296 n度寝
ユーザー jimanojimano
提出日時 2018-01-27 14:17:34
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 726 bytes
コンパイル時間 4,344 ms
コンパイル使用メモリ 77,032 KB
実行使用メモリ 53,844 KB
最終ジャッジ日時 2023-08-28 09:50:48
合計ジャッジ時間 6,541 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 75 ms
52,084 KB
testcase_04 AC 76 ms
52,720 KB
testcase_05 AC 74 ms
50,856 KB
testcase_06 AC 74 ms
51,668 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 72 ms
51,880 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 75 ms
52,400 KB
testcase_14 WA -
testcase_15 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

package me.yukicoder.wip;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class No0296_2 {
	public static void main(String[] args) {
		try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in));) {
			String[] str = br.readLine().split(" ");
			int n = Integer.parseInt(str[0]);
			int h = Integer.parseInt(str[1]);
			int m = Integer.parseInt(str[2]);
			int t = Integer.parseInt(str[3]);

			for (int i = 0; i < n - 1; i++) {
				m += t;
				if (m > 59) {
					h += m / 60;
					// 繰り上げ
					m = m % 60;
					h = (h > 23) ? h : h - 24;
				}
			}

			System.out.print(h + "\n" + m);
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
}
0