結果

問題 No.296 n度寝
ユーザー ribennge
提出日時 2018-09-30 13:22:39
言語 Java
(openjdk 23)
結果
AC  
実行時間 137 ms / 1,000 ms
コード長 434 bytes
コンパイル時間 2,259 ms
コンパイル使用メモリ 73,780 KB
実行使用メモリ 41,616 KB
最終ジャッジ日時 2024-10-12 09:01:44
合計ジャッジ時間 5,189 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 16
権限があれば一括ダウンロードができます

ソースコード

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();
		
		M += (N - 1) * T;
		
		for(;;) {
		if(M < 60) {
		break;
		}else {
		H++;
		M -= 60;
		if(H > 23) {
			H = 0;
		}
		}
		
		}
		
		sc.close();
		
		System.out.println(H);
		System.out.println(M);
		
	}
	

}
0