結果

問題 No.296 n度寝
ユーザー YamaKasaYamaKasa
提出日時 2018-05-02 00:50:49
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 544 bytes
コンパイル時間 1,996 ms
コンパイル使用メモリ 71,324 KB
実行使用メモリ 56,084 KB
最終ジャッジ日時 2023-09-10 08:49:38
合計ジャッジ時間 4,995 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 125 ms
55,960 KB
testcase_04 AC 121 ms
53,728 KB
testcase_05 AC 123 ms
55,860 KB
testcase_06 AC 125 ms
55,740 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 123 ms
55,580 KB
testcase_11 AC 123 ms
55,724 KB
testcase_12 WA -
testcase_13 AC 123 ms
55,628 KB
testcase_14 AC 122 ms
56,084 KB
testcase_15 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int N = scan.nextInt();
		int H = scan.nextInt();
		int M = scan.nextInt();
		int T = scan.nextInt();
		scan.close();

		int t = H * 60 +  M;
		int max = 23 * 60 + 59;
		int k = ((N - 1) * T) % max;
		//System.out.println(k);
		int m = 0;
		if(k <= max - t) {
			m = t + k;
		}else {
			m = k - (max - t);
		}
		int ans1 = m / 60;
		int ans2 = m % 60;
		System.out.println(ans1);
		System.out.println(ans2);
	}
}
0