結果

問題 No.296 n度寝
ユーザー ohagi_1182ohagi_1182
提出日時 2017-10-13 22:30:16
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 471 bytes
コンパイル時間 1,878 ms
コンパイル使用メモリ 71,156 KB
実行使用メモリ 58,080 KB
最終ジャッジ日時 2023-08-11 00:25:41
合計ジャッジ時間 4,958 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 121 ms
55,792 KB
testcase_03 AC 119 ms
55,800 KB
testcase_04 AC 120 ms
55,804 KB
testcase_05 AC 115 ms
55,552 KB
testcase_06 AC 112 ms
55,692 KB
testcase_07 WA -
testcase_08 AC 120 ms
55,596 KB
testcase_09 AC 118 ms
56,264 KB
testcase_10 AC 118 ms
56,056 KB
testcase_11 AC 116 ms
56,236 KB
testcase_12 AC 116 ms
56,648 KB
testcase_13 AC 114 ms
55,824 KB
testcase_14 AC 111 ms
55,844 KB
testcase_15 AC 123 ms
55,908 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();
		int ans1 = 0; int ans2 = 0;
		int x = h * 60 * 60 + m * 60;
		for(int i = 0 ; i < n - 1 ; i++) {
			x += t * 60;
		}
		x %= 3600 * 24;
		ans1 = x / 3600;
		ans2 = (x - ans1 * 3600) / 60;
		System.out.println(ans1);
		System.out.println(ans2);
	}
}
0