結果

問題 No.296 n度寝
ユーザー springspring
提出日時 2019-06-13 10:12:16
言語 Java21
(openjdk 21)
結果
AC  
実行時間 121 ms / 1,000 ms
コード長 441 bytes
コンパイル時間 2,203 ms
コンパイル使用メモリ 73,824 KB
実行使用メモリ 41,428 KB
最終ジャッジ日時 2024-04-21 01:09:43
合計ジャッジ時間 4,330 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 121 ms
41,188 KB
testcase_01 AC 118 ms
41,264 KB
testcase_02 AC 112 ms
41,108 KB
testcase_03 AC 117 ms
41,136 KB
testcase_04 AC 120 ms
41,428 KB
testcase_05 AC 109 ms
40,660 KB
testcase_06 AC 104 ms
39,972 KB
testcase_07 AC 117 ms
41,164 KB
testcase_08 AC 106 ms
40,120 KB
testcase_09 AC 114 ms
41,156 KB
testcase_10 AC 114 ms
41,388 KB
testcase_11 AC 114 ms
41,328 KB
testcase_12 AC 117 ms
41,328 KB
testcase_13 AC 118 ms
41,032 KB
testcase_14 AC 108 ms
40,472 KB
testcase_15 AC 113 ms
41,164 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

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();
		sc.close();
		int sleepMin = (N-1)*T;
		int minutes = (M+sleepMin)%60;
		int sleepHour = ((M+sleepMin)/60);
		H = (H+sleepHour)%24;
		System.out.println(H);
		System.out.println(minutes);
	}// mainmethod

} // class
0