結果

問題 No.1632 Sorting Integers (GCD of M)
ユーザー chineristACchineristAC
提出日時 2021-07-30 21:12:36
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 812 bytes
コンパイル時間 663 ms
コンパイル使用メモリ 86,620 KB
実行使用メモリ 74,624 KB
最終ジャッジ日時 2023-10-14 02:41:43
合計ジャッジ時間 10,649 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 115 ms
74,528 KB
testcase_01 AC 113 ms
74,172 KB
testcase_02 WA -
testcase_03 AC 112 ms
74,116 KB
testcase_04 AC 113 ms
74,300 KB
testcase_05 AC 112 ms
74,296 KB
testcase_06 AC 111 ms
74,484 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 112 ms
74,448 KB
testcase_11 AC 113 ms
74,356 KB
testcase_12 AC 110 ms
74,528 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 113 ms
74,560 KB
testcase_17 AC 113 ms
74,512 KB
testcase_18 AC 113 ms
74,360 KB
testcase_19 WA -
testcase_20 AC 113 ms
74,532 KB
testcase_21 WA -
testcase_22 AC 116 ms
74,264 KB
testcase_23 AC 113 ms
74,352 KB
testcase_24 AC 113 ms
74,076 KB
testcase_25 AC 113 ms
74,348 KB
testcase_26 WA -
testcase_27 AC 113 ms
74,192 KB
testcase_28 AC 115 ms
74,428 KB
testcase_29 AC 112 ms
74,260 KB
testcase_30 AC 113 ms
74,448 KB
testcase_31 AC 112 ms
74,528 KB
testcase_32 AC 113 ms
74,620 KB
testcase_33 AC 113 ms
74,456 KB
testcase_34 WA -
testcase_35 AC 114 ms
74,232 KB
testcase_36 AC 115 ms
74,348 KB
testcase_37 WA -
testcase_38 AC 112 ms
74,288 KB
testcase_39 AC 113 ms
74,064 KB
testcase_40 AC 114 ms
74,564 KB
testcase_41 AC 111 ms
74,348 KB
testcase_42 AC 112 ms
74,284 KB
testcase_43 WA -
testcase_44 AC 111 ms
74,484 KB
testcase_45 AC 111 ms
74,280 KB
testcase_46 WA -
testcase_47 AC 113 ms
74,204 KB
testcase_48 AC 112 ms
74,472 KB
testcase_49 AC 111 ms
74,508 KB
testcase_50 AC 113 ms
74,236 KB
testcase_51 AC 116 ms
74,188 KB
testcase_52 AC 112 ms
74,196 KB
testcase_53 AC 112 ms
74,484 KB
testcase_54 AC 113 ms
74,420 KB
testcase_55 AC 112 ms
74,572 KB
testcase_56 AC 112 ms
74,428 KB
testcase_57 AC 110 ms
74,576 KB
testcase_58 AC 110 ms
74,240 KB
testcase_59 WA -
testcase_60 WA -
testcase_61 WA -
testcase_62 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys,random,bisect
from collections import deque,defaultdict
from heapq import heapify,heappop,heappush
from itertools import permutations
from math import gcd,log

input = lambda :sys.stdin.readline().rstrip()
mi = lambda :map(int,input().split())
li = lambda :list(mi())

mod = 10**9 + 7
i9 = pow(9,mod-2,mod)

N = int(input())
c = [0] + li()

def solve(N,c):
    for i in range(10):
        if c[i]==N:
            return c[i] * (pow(10,N,mod)-1) * i9 % mod

    res = 1
    if any(c[2*i+1] for i in range(0,5)):
        res *= 1
    elif c[2] or c[6]:
        res *= 2
    elif c[4]:
        res *= 4
    else:
        res *= 8

    check = 0
    for i in range(10):
        check += c[i] * i
    if check%9==0:
        res *= 9
    elif check%3==0:
        res *= 3

    return res

print(solve(N,c))
0