結果

問題 No.653 E869120 and Lucky Numbers
ユーザー tentententen
提出日時 2023-01-31 13:33:41
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 1,925 bytes
コンパイル時間 3,026 ms
コンパイル使用メモリ 86,852 KB
実行使用メモリ 49,996 KB
最終ジャッジ日時 2023-09-13 07:02:34
合計ジャッジ時間 5,371 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 43 ms
49,420 KB
testcase_01 AC 44 ms
49,296 KB
testcase_02 AC 43 ms
49,448 KB
testcase_03 AC 44 ms
49,556 KB
testcase_04 AC 43 ms
49,620 KB
testcase_05 AC 44 ms
49,392 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 45 ms
49,756 KB
testcase_09 AC 42 ms
49,512 KB
testcase_10 AC 43 ms
49,996 KB
testcase_11 AC 41 ms
49,448 KB
testcase_12 AC 41 ms
49,740 KB
testcase_13 AC 41 ms
49,396 KB
testcase_14 AC 41 ms
49,416 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 41 ms
49,448 KB
testcase_18 AC 41 ms
49,556 KB
testcase_19 AC 43 ms
49,568 KB
testcase_20 AC 42 ms
49,372 KB
testcase_21 AC 44 ms
49,516 KB
testcase_22 AC 41 ms
49,736 KB
testcase_23 AC 42 ms
49,400 KB
testcase_24 AC 42 ms
49,532 KB
testcase_25 AC 43 ms
49,384 KB
testcase_26 AC 42 ms
49,444 KB
testcase_27 AC 42 ms
49,464 KB
testcase_28 WA -
testcase_29 WA -
testcase_30 AC 49 ms
49,440 KB
testcase_31 AC 41 ms
49,464 KB
testcase_32 AC 42 ms
49,436 KB
testcase_33 AC 41 ms
49,372 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.*;
import java.util.*;
import java.util.stream.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner();
        char[] p = sc.next().toCharArray();
        if (p[0] != '1') {
            System.out.println("No");
            return;
        }
        for (int i = 1; i < p.length - 1; i++) {
            if (p[i] >= '3' && p[i] <= '5') {
                continue;
            }
            System.out.println("No");
            return;
        }
        if (p[p.length - 1] >= '2' && p[p.length - 1] <= '4') {
            System.out.println("Yes");
        } else {
            System.out.println("No");
        }
    }
}

class Utilities {
    static String arrayToLineString(Object[] arr) {
        return Arrays.stream(arr).map(x -> x.toString()).collect(Collectors.joining("\n"));
    }
    
    static String arrayToLineString(int[] arr) {
        return String.join("\n", Arrays.stream(arr).mapToObj(String::valueOf).toArray(String[]::new));
    }
}
class Scanner {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    StringTokenizer st = new StringTokenizer("");
    StringBuilder sb = new StringBuilder();
    
    public Scanner() throws Exception {
        
    }
    
    public int nextInt() throws Exception {
        return Integer.parseInt(next());
    }
    
    public long nextLong() throws Exception {
        return Long.parseLong(next());
    }
    
    public double nextDouble() throws Exception {
        return Double.parseDouble(next());
    }
    
    public int[] nextIntArray() throws Exception {
        return Stream.of(br.readLine().split(" ")).mapToInt(Integer::parseInt).toArray();
    }
    
    public String next() throws Exception {
        while (!st.hasMoreTokens()) {
            st = new StringTokenizer(br.readLine());
        }
        return st.nextToken();
    }
    
}
0