結果

問題 No.1632 Sorting Integers (GCD of M)
ユーザー 👑 KazunKazun
提出日時 2021-08-09 03:40:02
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 450 bytes
コンパイル時間 168 ms
コンパイル使用メモリ 81,836 KB
実行使用メモリ 198,308 KB
最終ジャッジ日時 2023-10-20 04:16:17
合計ジャッジ時間 8,451 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
53,544 KB
testcase_01 AC 35 ms
53,544 KB
testcase_02 AC 36 ms
53,544 KB
testcase_03 AC 35 ms
53,544 KB
testcase_04 AC 36 ms
53,544 KB
testcase_05 AC 36 ms
53,544 KB
testcase_06 AC 37 ms
53,544 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 35 ms
53,544 KB
testcase_11 AC 37 ms
53,544 KB
testcase_12 AC 37 ms
53,544 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 37 ms
53,544 KB
testcase_17 AC 36 ms
53,544 KB
testcase_18 AC 37 ms
53,544 KB
testcase_19 WA -
testcase_20 AC 37 ms
53,544 KB
testcase_21 WA -
testcase_22 AC 36 ms
53,544 KB
testcase_23 AC 35 ms
53,544 KB
testcase_24 AC 36 ms
53,544 KB
testcase_25 AC 35 ms
53,544 KB
testcase_26 WA -
testcase_27 AC 35 ms
53,544 KB
testcase_28 AC 35 ms
53,544 KB
testcase_29 AC 35 ms
53,544 KB
testcase_30 AC 35 ms
53,544 KB
testcase_31 AC 35 ms
53,544 KB
testcase_32 AC 35 ms
53,544 KB
testcase_33 AC 35 ms
53,544 KB
testcase_34 WA -
testcase_35 AC 38 ms
53,544 KB
testcase_36 AC 35 ms
53,544 KB
testcase_37 WA -
testcase_38 AC 34 ms
53,544 KB
testcase_39 AC 34 ms
53,544 KB
testcase_40 AC 36 ms
53,544 KB
testcase_41 AC 37 ms
53,544 KB
testcase_42 AC 36 ms
53,544 KB
testcase_43 WA -
testcase_44 AC 35 ms
53,544 KB
testcase_45 AC 38 ms
53,544 KB
testcase_46 WA -
testcase_47 AC 35 ms
53,544 KB
testcase_48 AC 35 ms
53,544 KB
testcase_49 AC 36 ms
53,544 KB
testcase_50 AC 36 ms
53,544 KB
testcase_51 AC 35 ms
53,544 KB
testcase_52 AC 35 ms
53,544 KB
testcase_53 AC 35 ms
53,544 KB
testcase_54 AC 36 ms
53,544 KB
testcase_55 AC 36 ms
53,544 KB
testcase_56 AC 35 ms
53,544 KB
testcase_57 AC 40 ms
53,544 KB
testcase_58 AC 36 ms
53,544 KB
testcase_59 TLE -
testcase_60 -- -
testcase_61 -- -
testcase_62 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

N=int(input())
C=["*"]+list(map(int,input().split()))
Mod=10**9+7

#コーナーケース処理
F=0; I=0
for i in range(1,10):
    if C[i]:
        F+=1
        I=i

if F==1:
    X=I*(pow(10,N)-1)*pow(9,Mod-2,Mod)
    X%=Mod
    exit(print(X))

M=1
#2の倍数?
if C[1]==C[3]==C[5]==C[7]==C[9]==0:
    M*=2

    if C[2]==C[6]==0:
        M*=2

#3の倍数?
T=0
for i in range(1,10):
    T+=i*C[i]

if T%9==0:
    M*=9
elif T%3==0:
    M*=3

print(M)
0