結果

問題 No.296 n度寝
ユーザー AoiroFukurouAoiroFukurou
提出日時 2016-01-05 15:21:46
言語 Java21
(openjdk 21)
結果
AC  
実行時間 144 ms / 1,000 ms
コード長 647 bytes
コンパイル時間 3,541 ms
コンパイル使用メモリ 75,292 KB
実行使用メモリ 55,984 KB
最終ジャッジ日時 2023-09-21 08:18:30
合計ジャッジ時間 6,702 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 142 ms
55,984 KB
testcase_01 AC 141 ms
55,932 KB
testcase_02 AC 138 ms
55,704 KB
testcase_03 AC 126 ms
55,828 KB
testcase_04 AC 127 ms
55,664 KB
testcase_05 AC 131 ms
55,876 KB
testcase_06 AC 124 ms
55,612 KB
testcase_07 AC 140 ms
55,728 KB
testcase_08 AC 144 ms
55,840 KB
testcase_09 AC 127 ms
55,516 KB
testcase_10 AC 125 ms
55,648 KB
testcase_11 AC 128 ms
55,624 KB
testcase_12 AC 125 ms
55,888 KB
testcase_13 AC 125 ms
55,980 KB
testcase_14 AC 129 ms
55,676 KB
testcase_15 AC 130 ms
55,416 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