結果

問題 No.2201 p@$$w0rd
ユーザー AsahiAsahi
提出日時 2023-02-03 21:29:42
言語 Java21
(openjdk 21)
結果
AC  
実行時間 122 ms / 2,000 ms
コード長 2,176 bytes
コンパイル時間 4,480 ms
コンパイル使用メモリ 79,856 KB
実行使用メモリ 56,208 KB
最終ジャッジ日時 2023-09-15 16:55:56
合計ジャッジ時間 6,424 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 118 ms
55,524 KB
testcase_01 AC 116 ms
55,676 KB
testcase_02 AC 117 ms
56,208 KB
testcase_03 AC 118 ms
55,948 KB
testcase_04 AC 117 ms
55,648 KB
testcase_05 AC 116 ms
55,416 KB
testcase_06 AC 117 ms
55,956 KB
testcase_07 AC 119 ms
55,856 KB
testcase_08 AC 118 ms
55,408 KB
testcase_09 AC 116 ms
55,888 KB
testcase_10 AC 117 ms
55,828 KB
testcase_11 AC 122 ms
55,800 KB
testcase_12 AC 116 ms
55,696 KB
testcase_13 AC 116 ms
55,940 KB
testcase_14 AC 118 ms
55,608 KB
testcase_15 AC 120 ms
55,712 KB
testcase_16 AC 118 ms
55,656 KB
testcase_17 AC 117 ms
55,648 KB
testcase_18 AC 116 ms
55,420 KB
testcase_19 AC 116 ms
55,640 KB
testcase_20 AC 116 ms
55,968 KB
testcase_21 AC 118 ms
55,404 KB
testcase_22 AC 117 ms
55,728 KB
testcase_23 AC 119 ms
55,876 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

public class Main{
    /* 入出力 */
    static BufferedReader buff = new BufferedReader(new InputStreamReader(System.in));
    static StringTokenizer st;
    static PrintWriter output = new PrintWriter(System.out);
    static Scanner sc = new Scanner(System.in);
    /* 定数 */
    static final int [] y4 = {0,1,0,-1};
    static final int [] x4 = {1,0,-1,0};
    static final int  INF1 = Integer.MAX_VALUE;
    static final long INF2 = Long.MAX_VALUE;
    static final long MOD1 = (long)1e9+7;
    static final long MOD2 = 998244353;
    /* Main */
    public static void main(String[] args) throws IOException{
        /*
         * bit全探索
         */
        String s = sc.next();
        int len = s.length();
        int ans = 0;
        Set<String> size = new HashSet<>();
        for(int i=0;i<(1<<len);i++) {
            int c1 = 0;
            int c2 = 0;
            int c3 = 0;
            StringBuilder sb = new StringBuilder();
            for(int j=0;j<len;j++) {
                int bit = (i>>j)&1;
                if(bit == 1) {
                    if(s.charAt(j) == 'l'){
                        sb.append("1");
                        c2++;
                    }
                    else if(s.charAt(j) == 'o'){
                        sb.append("0");
                        c2++;
                    }
                    else if(s.charAt(j) == 'a'){
                        sb.append("@");
                        c3++;
                    }
                    else if(s.charAt(j) == 's'){
                        sb.append("$");
                        c3++;
                    }
                    else{
                        sb.append(s.substring(j,j+1));
                        c1++;
                    }
                }
                else{
                    sb.append(s.substring(j,j+1));
                    c1++;
                }
            }
            if(c1 >= 1 && c2 >= 1 && c3 >= 1) {
                size.add(sb.toString());
            }
        }
        output.print(size.size());
        output.flush();        
    }
}
0