結果

問題 No.832 麻雀修行中
ユーザー stngstng
提出日時 2022-07-10 12:49:17
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 1,470 bytes
コンパイル時間 368 ms
コンパイル使用メモリ 87,180 KB
実行使用メモリ 76,936 KB
最終ジャッジ日時 2023-08-30 23:32:52
合計ジャッジ時間 4,671 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 86 ms
76,664 KB
testcase_01 WA -
testcase_02 AC 81 ms
76,052 KB
testcase_03 AC 82 ms
76,576 KB
testcase_04 AC 82 ms
76,256 KB
testcase_05 AC 82 ms
75,936 KB
testcase_06 AC 78 ms
76,112 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 80 ms
76,280 KB
testcase_10 AC 81 ms
76,144 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 86 ms
76,820 KB
testcase_16 AC 83 ms
76,108 KB
testcase_17 AC 84 ms
76,736 KB
testcase_18 AC 83 ms
76,176 KB
testcase_19 AC 82 ms
76,336 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 84 ms
76,444 KB
testcase_23 WA -
testcase_24 AC 81 ms
76,120 KB
testcase_25 AC 82 ms
76,104 KB
testcase_26 AC 85 ms
76,256 KB
testcase_27 AC 80 ms
76,164 KB
testcase_28 AC 84 ms
76,756 KB
testcase_29 AC 78 ms
75,948 KB
testcase_30 AC 81 ms
76,340 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**3
ans = set()
for i in range(1,10):
    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
        for k in range(num):
            tmp = str(base10to(k,2)).zfill(2)
            for l in range(2):
                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]

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

    s = li[:]

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





0