結果

問題 No.296 n度寝
ユーザー kohaku_kohaku
提出日時 2016-11-13 07:19:36
言語 Java
(openjdk 23)
結果
AC  
実行時間 123 ms / 1,000 ms
コード長 476 bytes
コンパイル時間 2,120 ms
コンパイル使用メモリ 74,288 KB
実行使用メモリ 41,680 KB
最終ジャッジ日時 2024-07-07 02:51:29
合計ジャッジ時間 4,112 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 16
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int H = sc.nextInt();
        int M = sc.nextInt();
        int T = sc.nextInt();
        
        M = M + (N-1)*T;
        while(M>=60){
            M=M-60;
            H++;
        }
        while(H>=24){
            H=H-24;
        }
        System.out.println(H);
        System.out.println(M);
    }
}
0