結果

問題 No.296 n度寝
ユーザー jonki324
提出日時 2018-06-06 17:14:51
言語 Java
(openjdk 23)
結果
WA  
実行時間 -
コード長 589 bytes
コンパイル時間 2,054 ms
コンパイル使用メモリ 74,036 KB
実行使用メモリ 41,652 KB
最終ジャッジ日時 2024-06-30 10:16:23
合計ジャッジ時間 4,875 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 11 WA * 5
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

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();

        int tmp = (n - 1) * t;
        int ch = tmp / 60;
        int cm = tmp - ch * 60;

        if ( (m += cm) >= 60 ) {
            m -= 60;
            ch++;
        }
        if ( (h += ch) >= 24 ) {
            h -= 24;
        }
        System.out.println(h);
        System.out.println(m);
        scan.close();
    }
}
0