結果

問題 No.632 穴埋め門松列
ユーザー tenten
提出日時 2020-12-09 18:23:13
言語 Java
(openjdk 23)
結果
AC  
実行時間 115 ms / 1,000 ms
コード長 674 bytes
コンパイル時間 2,128 ms
コンパイル使用メモリ 74,064 KB
実行使用メモリ 41,612 KB
最終ジャッジ日時 2024-09-19 01:21:48
合計ジャッジ時間 2,863 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 6
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        char[] arr = new char[3];
        for (int i = 0; i < 3; i++) {
            arr[i] = sc.next().charAt(0);
        }
        String ans;
        if (arr[0] == '?') {
            if (arr[1] == '2') {
                ans = "4";
            } else {
                ans = "1";
            }
        } else if (arr[1] == '?') {
            ans = "14";
        } else {
            if (arr[0] == '2') {
                ans = "1";
            } else {
                ans = "4";
            }
        }
       System.out.println(ans);
    }
}
0