結果

問題 No.296 n度寝
ユーザー mtokmtok
提出日時 2016-04-01 16:52:29
言語 Java21
(openjdk 21)
結果
AC  
実行時間 74 ms / 1,000 ms
コード長 675 bytes
コンパイル時間 1,849 ms
コンパイル使用メモリ 71,296 KB
実行使用メモリ 51,232 KB
最終ジャッジ日時 2023-09-21 08:22:19
合計ジャッジ時間 3,413 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 69 ms
51,216 KB
testcase_01 AC 60 ms
51,232 KB
testcase_02 AC 47 ms
49,308 KB
testcase_03 AC 43 ms
47,516 KB
testcase_04 AC 43 ms
49,380 KB
testcase_05 AC 43 ms
49,504 KB
testcase_06 AC 43 ms
49,332 KB
testcase_07 AC 74 ms
51,128 KB
testcase_08 AC 54 ms
50,136 KB
testcase_09 AC 43 ms
49,584 KB
testcase_10 AC 42 ms
49,484 KB
testcase_11 AC 43 ms
49,588 KB
testcase_12 AC 43 ms
49,404 KB
testcase_13 AC 42 ms
49,324 KB
testcase_14 AC 43 ms
49,924 KB
testcase_15 AC 43 ms
49,444 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] args)throws Exception{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String line = br.readLine();
        String[] str = line.split(" ");
        int n=Integer.parseInt(str[0]),h=Integer.parseInt(str[1]),m=Integer.parseInt(str[2]),t=Integer.parseInt(str[3]);
        while(n>1){
        	n--;
        	m+=t;
        	while(m>=60){
        		m-=60;
        		h++;
            	if(h>=24){
            		h-=24;
            	}
        	}
        }
        System.out.println(h);
        System.out.println(m);
	}
}
0