結果

問題 No.832 麻雀修行中
ユーザー stngstng
提出日時 2022-07-10 12:56:04
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 1,503 bytes
コンパイル時間 476 ms
コンパイル使用メモリ 87,052 KB
実行使用メモリ 78,396 KB
最終ジャッジ日時 2023-08-30 23:40:39
合計ジャッジ時間 4,750 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 109 ms
77,820 KB
testcase_01 AC 92 ms
76,336 KB
testcase_02 AC 92 ms
76,376 KB
testcase_03 AC 97 ms
76,784 KB
testcase_04 AC 101 ms
76,824 KB
testcase_05 AC 98 ms
76,848 KB
testcase_06 AC 96 ms
76,940 KB
testcase_07 AC 98 ms
76,740 KB
testcase_08 AC 97 ms
76,808 KB
testcase_09 AC 100 ms
77,092 KB
testcase_10 AC 96 ms
76,980 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 107 ms
77,484 KB
testcase_14 WA -
testcase_15 AC 115 ms
77,948 KB
testcase_16 AC 115 ms
77,672 KB
testcase_17 AC 113 ms
77,744 KB
testcase_18 AC 106 ms
77,852 KB
testcase_19 AC 104 ms
77,672 KB
testcase_20 AC 96 ms
76,744 KB
testcase_21 WA -
testcase_22 AC 117 ms
78,008 KB
testcase_23 WA -
testcase_24 AC 103 ms
76,684 KB
testcase_25 AC 104 ms
76,640 KB
testcase_26 AC 116 ms
77,924 KB
testcase_27 AC 90 ms
76,520 KB
testcase_28 AC 119 ms
78,048 KB
testcase_29 AC 87 ms
76,940 KB
testcase_30 AC 100 ms
76,808 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def base10to(n, b):
    if (int(n/b)):
        return base10to(int(n/b), b) + str(n%b)
    return str(n%b)

s = input()
li = [0]*10
for i in range(len(s)):
    li[int(s[i])] += 1

s = li[:]

num = 2**4
ans = set()
for i in range(1,10):
    s = li[:]
    if s[i] == 4:
        continue
    s[i] += 1
    ori = s[:]
    f = True
    for j in range(10):
        if s[j] != 0 and s[j] != 2:
            f = False
           
    if f == True:
        ans.add(i)
        continue

    for j in range(1,10):
        s = ori[:]
        if s[j] >= 2:
            s[j] -= 2
        else:
            continue
        ori2 = s[:]
        for k in range(num):
            s = ori2[:]
            tmp = str(base10to(k,2)).zfill(4)
            for l in range(4):
                if tmp[l] == "0":
                    for m in range(1,10):
                        if s[m] >= 3:
                            s[m] -= 3
                            break
                if tmp[l] == "1":
                    for m in range(1,8):
                        if s[m] >= 1 and s[m+1] >= 1 and s[m+2] >= 1:
                            s[m] -= 1
                            s[m+1] -= 1
                            s[m+2] -= 1
                #if tmp[l] == "2":
                #    for m in range(3,10):
                #        if s[m-2] >= 1 and s[m-1] >= 1 and s[m]

            if sum(s) == 0:
                ans.add(i)
                break

    

ans = list(ans)
ans.sort()
for i in range(len(ans)):
    print(ans[i])





0