結果

問題 No.296 n度寝
ユーザー AoiroFukurouAoiroFukurou
提出日時 2016-01-05 15:24:20
言語 Java21
(openjdk 21)
結果
AC  
実行時間 143 ms / 1,000 ms
コード長 647 bytes
コンパイル時間 4,228 ms
コンパイル使用メモリ 74,680 KB
実行使用メモリ 56,020 KB
最終ジャッジ日時 2023-09-21 08:19:17
合計ジャッジ時間 7,470 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 143 ms
55,424 KB
testcase_01 AC 136 ms
55,544 KB
testcase_02 AC 138 ms
55,968 KB
testcase_03 AC 129 ms
56,020 KB
testcase_04 AC 128 ms
55,752 KB
testcase_05 AC 126 ms
55,696 KB
testcase_06 AC 125 ms
55,768 KB
testcase_07 AC 140 ms
55,584 KB
testcase_08 AC 140 ms
55,428 KB
testcase_09 AC 127 ms
55,996 KB
testcase_10 AC 127 ms
55,860 KB
testcase_11 AC 125 ms
55,448 KB
testcase_12 AC 124 ms
55,696 KB
testcase_13 AC 125 ms
53,848 KB
testcase_14 AC 123 ms
55,416 KB
testcase_15 AC 124 ms
55,636 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package yuki_coder;

import java.util.Scanner;

public class No_296 {
public static void main(String[] args) {
	Scanner sc = new Scanner(System.in);
	String s = sc.nextLine();
	sc.close();
	String[] str = s.split(" ", 0);
	int[] n = new int[4];
	for(int i = 0; i < 4; i++){
		n[i] = Integer.parseInt(str[i]);
	}
	n[0]--;
	
	for(int i = 0; i < n[0]; i++){
		if(n[0] == 1440){
			break;
		}
		int h = 0;
		int m = 0;
		m += (n[3] % 60);
		n[2] += m;
		m =0;
		if(n[2] >= 60){
			n[1]++;
			n[2] -= 60;
		}
		h += (n[3] / 60);
		n[1] += h;
		h = 0;
		while(n[1] >= 24){
			n[1] -= 24;
		}
	}
	System.out.println(n[1]);
	System.out.println(n[2]);
}
}
0