結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 160 ms
56,884 KB
testcase_01 AC 156 ms
56,640 KB
testcase_02 AC 153 ms
56,692 KB
testcase_03 AC 148 ms
56,576 KB
testcase_04 AC 145 ms
56,740 KB
testcase_05 AC 146 ms
56,676 KB
testcase_06 AC 146 ms
57,076 KB
testcase_07 AC 164 ms
56,696 KB
testcase_08 AC 153 ms
56,464 KB
testcase_09 AC 149 ms
56,760 KB
testcase_10 AC 145 ms
56,604 KB
testcase_11 AC 149 ms
54,820 KB
testcase_12 AC 153 ms
56,844 KB
testcase_13 AC 146 ms
56,872 KB
testcase_14 AC 148 ms
56,864 KB
testcase_15 AC 148 ms
56,600 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