結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 118 ms
74,544 KB
testcase_01 AC 123 ms
74,600 KB
testcase_02 AC 121 ms
74,284 KB
testcase_03 AC 121 ms
74,788 KB
testcase_04 AC 119 ms
74,720 KB
testcase_05 AC 126 ms
74,444 KB
testcase_06 AC 120 ms
74,604 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 118 ms
74,348 KB
testcase_11 AC 121 ms
74,712 KB
testcase_12 AC 125 ms
74,328 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 117 ms
74,188 KB
testcase_17 AC 119 ms
74,364 KB
testcase_18 AC 115 ms
74,276 KB
testcase_19 WA -
testcase_20 AC 122 ms
74,256 KB
testcase_21 WA -
testcase_22 AC 119 ms
74,736 KB
testcase_23 AC 123 ms
74,540 KB
testcase_24 AC 121 ms
74,160 KB
testcase_25 AC 117 ms
74,600 KB
testcase_26 WA -
testcase_27 AC 125 ms
74,276 KB
testcase_28 AC 126 ms
74,120 KB
testcase_29 AC 116 ms
74,660 KB
testcase_30 AC 116 ms
74,360 KB
testcase_31 AC 120 ms
74,164 KB
testcase_32 AC 121 ms
74,124 KB
testcase_33 AC 125 ms
74,212 KB
testcase_34 WA -
testcase_35 AC 121 ms
74,120 KB
testcase_36 AC 125 ms
74,416 KB
testcase_37 WA -
testcase_38 AC 122 ms
74,316 KB
testcase_39 AC 121 ms
74,356 KB
testcase_40 AC 120 ms
74,312 KB
testcase_41 AC 117 ms
74,344 KB
testcase_42 AC 117 ms
74,204 KB
testcase_43 WA -
testcase_44 AC 120 ms
74,212 KB
testcase_45 AC 121 ms
74,204 KB
testcase_46 WA -
testcase_47 AC 118 ms
74,168 KB
testcase_48 AC 115 ms
74,252 KB
testcase_49 AC 119 ms
74,364 KB
testcase_50 AC 121 ms
74,544 KB
testcase_51 AC 118 ms
74,316 KB
testcase_52 AC 122 ms
74,484 KB
testcase_53 AC 117 ms
74,128 KB
testcase_54 AC 119 ms
74,720 KB
testcase_55 AC 124 ms
74,120 KB
testcase_56 AC 122 ms
74,588 KB
testcase_57 AC 122 ms
74,164 KB
testcase_58 AC 124 ms
74,272 KB
testcase_59 AC 124 ms
74,312 KB
testcase_60 AC 124 ms
74,280 KB
testcase_61 AC 124 ms
74,128 KB
testcase_62 AC 118 ms
74,224 KB
権限があれば一括ダウンロードができます

ソースコード

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 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