結果

問題 No.525 二度寝の季節
ユーザー YamaKasa
提出日時 2018-05-06 18:38:36
言語 Java
(openjdk 23)
結果
AC  
実行時間 158 ms / 1,000 ms
コード長 1,052 bytes
コンパイル時間 2,170 ms
コンパイル使用メモリ 79,636 KB
実行使用メモリ 42,444 KB
最終ジャッジ日時 2024-06-28 02:11:12
合計ジャッジ時間 8,455 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 33
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		String T = scan.next();
		scan.close();
		int h;
		if(T.charAt(0) == '0') {
			h = Integer.parseInt(T.substring(1, 2));
		}else {
			h = Integer.parseInt(T.substring(0, 2));
		}
		int m;
		if(T.charAt(3) == '0') {
			m = Integer.parseInt(T.substring(4, 5));
		}else {
			m = Integer.parseInt(T.substring(3, 5));
		}
		if(m > 54) {
			if(h == 23) {
				int m1 = m + 5 - 60;
				System.out.println("00:0" + m1);
			}else {
				int m1 = m + 5 - 60;
				if(h < 9) {
					int h1 = h + 1;
					System.out.println("0" + h1 + ":0" + m1);
				}else {
					int h1 = h + 1;
					System.out.println(h1 + ":0" + m1);
				}

			}
		}else if(m < 4) {
			int m1 = m + 5;
			if(h < 9) {
				System.out.println("0" + h +":0" + m1);
			}else {
				System.out.println(h + ":0" + m1);
			}
		}else {
			int m1 = m + 5;
			if(h < 10) {
				System.out.println("0" + h +":" + m1);
			}else {
				System.out.println(h + ":" + m1);
			}
		}

	}
}
0