結果

問題 No.1632 Sorting Integers (GCD of M)
コンテスト
ユーザー sotanishy
提出日時 2021-07-30 22:45:21
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
WA  
実行時間 -
コード長 482 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 132 ms
コンパイル使用メモリ 84,736 KB
実行使用メモリ 52,224 KB
最終ジャッジ日時 2026-04-05 05:52:27
合計ジャッジ時間 3,086 ms
ジャッジサーバーID
(参考情報)
judge2_1 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 43 WA * 16
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

import sys
input = sys.stdin.readline

mod = 10**9 + 7
N = int(input())
c = [0] + list(map(int, input().split()))
# same digits
for d in range(1, 10):
    if c[d] == N:
        print(d * (pow(10, N, mod) - 1) * pow(9, mod-2, mod) % mod)
        exit()
ans = 1
if sum(c[2*i] for i in range(5)) == N:
    ans *= 2
if sum(c[4*i] for i in range(2)) == N:
    ans *= 2
total = sum(d * c[d] for d in range(1, 10))
if total % 3 == 0:
    ans *= 3
if total % 9 == 0:
    ans *= 3
print(ans)
0