結果

問題 No.296 n度寝
ユーザー garaisigaraisi
提出日時 2017-01-01 15:23:41
言語 Java21
(openjdk 21)
結果
AC  
実行時間 218 ms / 1,000 ms
コード長 681 bytes
コンパイル時間 2,107 ms
コンパイル使用メモリ 71,224 KB
実行使用メモリ 57,368 KB
最終ジャッジ日時 2023-09-21 08:31:39
合計ジャッジ時間 6,665 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 213 ms
56,368 KB
testcase_01 AC 209 ms
56,604 KB
testcase_02 AC 207 ms
56,192 KB
testcase_03 AC 196 ms
56,836 KB
testcase_04 AC 196 ms
56,940 KB
testcase_05 AC 208 ms
56,780 KB
testcase_06 AC 197 ms
56,484 KB
testcase_07 AC 218 ms
57,368 KB
testcase_08 AC 205 ms
56,736 KB
testcase_09 AC 206 ms
56,896 KB
testcase_10 AC 206 ms
56,888 KB
testcase_11 AC 198 ms
56,772 KB
testcase_12 AC 207 ms
56,820 KB
testcase_13 AC 205 ms
56,524 KB
testcase_14 AC 197 ms
56,808 KB
testcase_15 AC 208 ms
56,524 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Calendar;
import java.util.Date;
import java.util.Scanner;

public class Main {
	public static void main(String args[]){
		Scanner input = new Scanner(System.in);

		int sleeptimes = input.nextInt();
		int hour = input.nextInt();
		int minute = input.nextInt();
		int interval = input.nextInt();

		minute += interval * (sleeptimes-1);

		Calendar c = Calendar.getInstance();
		c.set(Calendar.HOUR_OF_DAY, hour);
		c.set(Calendar.MINUTE,minute);

		Date waketime = c.getTime();

		c.setTime(waketime);

		int wakehour = c.get(Calendar.HOUR_OF_DAY);
		int wakeminute = c.get(Calendar.MINUTE);

		System.out.println(wakehour);
		System.out.println(wakeminute);
	}
}
0