結果

問題 No.525 二度寝の季節
ユーザー YamaKasaYamaKasa
提出日時 2018-05-06 18:34:55
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 977 bytes
コンパイル時間 2,193 ms
コンパイル使用メモリ 76,060 KB
実行使用メモリ 57,228 KB
最終ジャッジ日時 2023-09-10 10:47:37
合計ジャッジ時間 8,957 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 146 ms
56,640 KB
testcase_01 AC 134 ms
54,144 KB
testcase_02 AC 146 ms
56,952 KB
testcase_03 AC 145 ms
56,576 KB
testcase_04 AC 144 ms
57,044 KB
testcase_05 AC 143 ms
56,780 KB
testcase_06 AC 144 ms
56,952 KB
testcase_07 AC 143 ms
56,896 KB
testcase_08 AC 144 ms
56,856 KB
testcase_09 AC 143 ms
57,140 KB
testcase_10 AC 146 ms
56,548 KB
testcase_11 AC 144 ms
56,784 KB
testcase_12 AC 142 ms
56,812 KB
testcase_13 AC 143 ms
56,812 KB
testcase_14 AC 144 ms
56,904 KB
testcase_15 AC 144 ms
56,980 KB
testcase_16 WA -
testcase_17 AC 146 ms
56,832 KB
testcase_18 AC 143 ms
56,824 KB
testcase_19 AC 145 ms
56,512 KB
testcase_20 AC 144 ms
56,632 KB
testcase_21 AC 145 ms
56,828 KB
testcase_22 AC 144 ms
54,820 KB
testcase_23 AC 144 ms
56,860 KB
testcase_24 WA -
testcase_25 AC 145 ms
56,824 KB
testcase_26 AC 144 ms
56,828 KB
testcase_27 WA -
testcase_28 AC 152 ms
56,852 KB
testcase_29 AC 150 ms
56,656 KB
testcase_30 AC 148 ms
56,884 KB
testcase_31 AC 148 ms
57,032 KB
testcase_32 AC 137 ms
55,648 KB
testcase_33 AC 143 ms
56,700 KB
testcase_34 AC 131 ms
55,708 KB
権限があれば一括ダウンロードができます

ソースコード

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 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 < 9) {
				System.out.println("0" + h +":" + m1);
			}else {
				System.out.println(h + ":" + m1);
			}
		}

	}
}
0