結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 122 ms
55,832 KB
testcase_01 AC 124 ms
55,508 KB
testcase_02 WA -
testcase_03 AC 122 ms
55,440 KB
testcase_04 AC 122 ms
55,876 KB
testcase_05 AC 120 ms
55,412 KB
testcase_06 AC 123 ms
55,880 KB
testcase_07 AC 122 ms
55,772 KB
testcase_08 AC 123 ms
55,864 KB
testcase_09 AC 121 ms
55,980 KB
testcase_10 AC 124 ms
55,760 KB
testcase_11 AC 122 ms
56,024 KB
testcase_12 AC 124 ms
56,008 KB
testcase_13 AC 123 ms
55,812 KB
testcase_14 AC 123 ms
55,712 KB
testcase_15 AC 122 ms
55,756 KB
権限があれば一括ダウンロードができます

ソースコード

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 = 24 * 60;
		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