結果

問題 No.296 n度寝
ユーザー misk703misk703
提出日時 2018-05-02 10:46:25
言語 Java21
(openjdk 21)
結果
AC  
実行時間 164 ms / 1,000 ms
コード長 537 bytes
コンパイル時間 3,459 ms
コンパイル使用メモリ 73,520 KB
実行使用メモリ 56,868 KB
最終ジャッジ日時 2023-09-10 08:51:33
合計ジャッジ時間 6,933 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 158 ms
56,600 KB
testcase_01 AC 152 ms
56,716 KB
testcase_02 AC 151 ms
56,552 KB
testcase_03 AC 146 ms
56,560 KB
testcase_04 AC 149 ms
56,680 KB
testcase_05 AC 150 ms
56,476 KB
testcase_06 AC 147 ms
56,596 KB
testcase_07 AC 164 ms
56,620 KB
testcase_08 AC 153 ms
56,784 KB
testcase_09 AC 145 ms
56,420 KB
testcase_10 AC 147 ms
56,416 KB
testcase_11 AC 152 ms
56,512 KB
testcase_12 AC 144 ms
56,636 KB
testcase_13 AC 143 ms
56,868 KB
testcase_14 AC 146 ms
56,644 KB
testcase_15 AC 144 ms
56,580 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class cade {

    public static void main(String[] args) {
	Scanner s = new Scanner(System.in);
	int[] A = new int[4];

	for(int i=0;i<4;i++){
	    A[i] = Integer.parseInt(s.next());
	}

	int h = A[1] * 60;

	int startmin = h + A[2];

	int Dmin = 24 * 60;
	for(int i=0;i<A[0]-1;i++){
	    startmin += A[3];
	    if(startmin >= Dmin){
		startmin %= Dmin;
	    }
	}

	int ansh= startmin / 60;
	if(ansh == 24){
	    ansh = 0;
	}
	int ansm= startmin % 60;

	System.out.println(ansh + "\n" + ansm);
    }

}
0