結果

問題 No.296 n度寝
ユーザー matsuyoshi30matsuyoshi30
提出日時 2017-03-09 21:36:23
言語 Java19
(openjdk 21)
結果
WA  
実行時間 -
コード長 729 bytes
コンパイル時間 2,111 ms
コンパイル使用メモリ 72,228 KB
実行使用メモリ 58,020 KB
最終ジャッジ日時 2023-09-06 05:33:35
合計ジャッジ時間 5,162 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 121 ms
55,912 KB
testcase_04 AC 124 ms
56,236 KB
testcase_05 AC 121 ms
55,840 KB
testcase_06 AC 123 ms
56,032 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 123 ms
55,792 KB
testcase_11 AC 121 ms
55,548 KB
testcase_12 WA -
testcase_13 AC 124 ms
56,000 KB
testcase_14 AC 121 ms
56,148 KB
testcase_15 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;

class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int h = in.nextInt();
        int m = in.nextInt();
        int t = in.nextInt();

        if(n == 1) {
            System.out.println(h);
            System.out.println(m);
        } else {
            for(int i=0; i<n-1; i++) {
                m += t;
                if(m >= 60) {
                    h++;
                    m -= 60;
                }
            }
            System.out.println(h);
            System.out.println(m);
        }

        in.close();
    }
}
0