結果

問題 No.443 GCD of Permutation
ユーザー rlangevinrlangevin
提出日時 2023-08-28 12:24:22
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 711 bytes
コンパイル時間 604 ms
コンパイル使用メモリ 87,092 KB
実行使用メモリ 76,228 KB
最終ジャッジ日時 2023-08-28 12:24:27
合計ジャッジ時間 4,664 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 72 ms
71,368 KB
testcase_02 AC 71 ms
71,092 KB
testcase_03 AC 71 ms
71,364 KB
testcase_04 AC 70 ms
70,984 KB
testcase_05 AC 70 ms
71,384 KB
testcase_06 AC 72 ms
71,028 KB
testcase_07 AC 71 ms
71,252 KB
testcase_08 AC 71 ms
71,148 KB
testcase_09 AC 72 ms
71,456 KB
testcase_10 AC 71 ms
71,360 KB
testcase_11 WA -
testcase_12 AC 76 ms
71,232 KB
testcase_13 AC 72 ms
71,388 KB
testcase_14 AC 76 ms
75,712 KB
testcase_15 AC 75 ms
75,804 KB
testcase_16 AC 75 ms
75,656 KB
testcase_17 AC 74 ms
75,912 KB
testcase_18 AC 74 ms
75,804 KB
testcase_19 AC 76 ms
75,912 KB
testcase_20 AC 76 ms
75,868 KB
testcase_21 AC 77 ms
75,904 KB
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 AC 81 ms
75,904 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 AC 76 ms
75,884 KB
testcase_29 WA -
testcase_30 AC 78 ms
75,904 KB
testcase_31 AC 76 ms
76,008 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = [int(n) for n in input()]
S = set(N)
if len(S) == 1:
    print(str(S.pop()) * len(N))
    exit()

L = [0] * 10
ans = 1
for i in [1, 3, 5, 7, 9]:
    if i in S:
        break
else:
    L[2] = 1

if sum(N) % 3 == 0:
    L[3] = 1
if sum(N) % 9 == 0:
    L[3] = 0
    L[9] = 1

for i in [1, 2, 3, 5, 6, 7, 9]:
    if i in S:
        break
else:
    L[2] = 0
    L[4] = 1

for i in [1, 2, 3, 4, 6, 7, 8, 9]:
    if i in S:
        break
else:
    L[5] = 1

for i in [1, 2, 3, 4, 5, 6, 8, 9]:
    if i in S:
        break
else:
    L[7] = 1

for i in [1, 2, 3, 4, 5, 6, 7, 9]:
    if i in S:
        break
else:
    L[2] = 0
    L[4] = 0
    L[8] = 1

for i in range(10):
    if L[i]:
        ans *= i

print(ans)
0