結果

問題 No.632 穴埋め門松列
ユーザー YukimotoPGYukimotoPG
提出日時 2019-02-13 15:11:54
言語 Java21
(openjdk 21)
結果
AC  
実行時間 125 ms / 1,000 ms
コード長 582 bytes
コンパイル時間 3,876 ms
コンパイル使用メモリ 74,460 KB
実行使用メモリ 56,116 KB
最終ジャッジ日時 2023-10-11 11:15:12
合計ジャッジ時間 3,782 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 125 ms
55,748 KB
testcase_01 AC 125 ms
55,812 KB
testcase_02 AC 124 ms
56,068 KB
testcase_03 AC 121 ms
55,956 KB
testcase_04 AC 123 ms
56,116 KB
testcase_05 AC 123 ms
55,784 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

class Main {
	static Scanner sc = new Scanner(System.in);
	public static void main(String[] args) {
		
		String s = sc.nextLine().replace(" ","");
		String one = s.replace("?","1");
		String four = s.replace("?","4");
		

		
		String ans = "";
		if (one.charAt(0)<one.charAt(1)&&one.charAt(1)>one.charAt(2) || one.charAt(0)>one.charAt(1)&&one.charAt(1)<one.charAt(2)) ans += "1";
		if (four.charAt(0)<four.charAt(1)&&four.charAt(1)>four.charAt(2) || four.charAt(0)>four.charAt(1)&&four.charAt(1)<four.charAt(2)) ans += "4";
		
		System.out.println(ans);
		
	}
}
0