結果

問題 No.1632 Sorting Integers (GCD of M)
ユーザー PSL24251284PSL24251284
提出日時 2021-07-31 00:29:08
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 615 bytes
コンパイル時間 983 ms
コンパイル使用メモリ 87,272 KB
実行使用メモリ 80,344 KB
最終ジャッジ日時 2023-10-14 09:24:34
合計ジャッジ時間 8,164 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,432 KB
testcase_01 AC 75 ms
71,376 KB
testcase_02 RE -
testcase_03 AC 74 ms
71,396 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 75 ms
71,324 KB
testcase_08 AC 76 ms
71,308 KB
testcase_09 AC 77 ms
71,408 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 74 ms
71,332 KB
testcase_14 AC 82 ms
71,336 KB
testcase_15 AC 74 ms
71,320 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 73 ms
71,336 KB
testcase_21 WA -
testcase_22 AC 72 ms
71,284 KB
testcase_23 AC 73 ms
71,340 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 AC 75 ms
71,528 KB
testcase_31 AC 74 ms
71,308 KB
testcase_32 AC 72 ms
71,704 KB
testcase_33 AC 75 ms
71,144 KB
testcase_34 WA -
testcase_35 AC 74 ms
71,656 KB
testcase_36 AC 75 ms
71,272 KB
testcase_37 WA -
testcase_38 AC 74 ms
71,652 KB
testcase_39 AC 73 ms
71,344 KB
testcase_40 AC 73 ms
71,660 KB
testcase_41 AC 72 ms
71,696 KB
testcase_42 AC 75 ms
71,092 KB
testcase_43 WA -
testcase_44 AC 76 ms
71,440 KB
testcase_45 AC 77 ms
71,652 KB
testcase_46 WA -
testcase_47 AC 75 ms
71,480 KB
testcase_48 AC 76 ms
71,408 KB
testcase_49 AC 80 ms
71,268 KB
testcase_50 AC 72 ms
71,528 KB
testcase_51 AC 75 ms
71,448 KB
testcase_52 AC 73 ms
71,404 KB
testcase_53 AC 73 ms
71,700 KB
testcase_54 AC 73 ms
71,328 KB
testcase_55 AC 76 ms
71,404 KB
testcase_56 AC 74 ms
71,660 KB
testcase_57 AC 74 ms
71,520 KB
testcase_58 AC 75 ms
71,352 KB
testcase_59 RE -
testcase_60 RE -
testcase_61 RE -
testcase_62 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

import math
N = int(input())
c = [0] + list(map(int,input().split()))
for i in range(10):
    if c[i] == N:
        ans = pow(10,N,mod)-1
        ans *= pow(9,mod-2,mod)
        ans %= mod
        ans *= i
        ans %= mod
        print(ans)
        exit()
        
x = 0
for i in range(10):
    x += (c[i]%9)*i
x %= 9
if x == 3 or x == 6:
    ans = 3
elif x == 0:
    ans = 9
else:
    ans = 1
g = 0
for i in range(10):
    for j in range(10):
        if i != j and c[i] >= 1 and c[j] >= 1:
            t = i-j
            while t%3 == 0:
                t //= 3
            g = math.gcd(g,t)
ans *= g
print(ans)
0