結果

問題 No.296 n度寝
ユーザー dazydazy
提出日時 2017-04-10 14:54:53
言語 Java21
(openjdk 21)
結果
AC  
実行時間 165 ms / 1,000 ms
コード長 572 bytes
コンパイル時間 3,553 ms
コンパイル使用メモリ 73,832 KB
実行使用メモリ 58,828 KB
最終ジャッジ日時 2023-09-25 06:46:53
合計ジャッジ時間 6,867 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 165 ms
56,856 KB
testcase_01 AC 159 ms
56,404 KB
testcase_02 AC 159 ms
56,808 KB
testcase_03 AC 158 ms
56,716 KB
testcase_04 AC 150 ms
56,544 KB
testcase_05 AC 149 ms
56,788 KB
testcase_06 AC 151 ms
56,952 KB
testcase_07 AC 162 ms
56,888 KB
testcase_08 AC 160 ms
56,744 KB
testcase_09 AC 155 ms
56,360 KB
testcase_10 AC 153 ms
56,924 KB
testcase_11 AC 152 ms
55,004 KB
testcase_12 AC 155 ms
56,572 KB
testcase_13 AC 152 ms
56,472 KB
testcase_14 AC 149 ms
58,828 KB
testcase_15 AC 152 ms
56,788 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Run {
    public static void main (String arg[]) {
        Scanner scan = new Scanner(System.in);

        int N = scan.nextInt();
        int H = scan.nextInt();
        int M = scan.nextInt();
        int T = scan.nextInt();

        int Th = T/60;
        int Tm = T%60;

        for (int i = 0; i < N - 1; i++) {
            M += Tm;
            if (M > 59) {
                H++;
                M %= 60;
            }
            H += Th;
            if (H > 23) H %= 24;
        }

        System.out.println(H + "\n" + M);
    }
}
0