結果

問題 No.1629 Sorting Integers (SUM of M)
ユーザー kagemeka
提出日時 2021-07-30 20:54:20
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
TLE  
実行時間 -
コード長 407 bytes
コンパイル時間 208 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 824,484 KB
最終ジャッジ日時 2024-09-15 22:44:01
合計ジャッジ時間 8,665 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3 TLE * 1
other MLE * 1 -- * 13
権限があれば一括ダウンロードができます

ソースコード

diff #

import typing 
from itertools import (
  permutations,
)
import numpy as np



def main() -> typing.NoReturn:
  mod = 10 ** 9 + 7
  n = int(input())
  *c, = map(
    int, input().split(),
  )
  a = []
  for i in range(9):
    a += [i + 1] * c[i]

  p = np.array((
    *permutations(a),
  ))
  p = np.unique(p, axis=0)
  d = 10 ** np.arange(n)
  s = p.sum(axis=0) % mod * d
  print(s.sum() % mod)


main()
  
0