結果
問題 |
No.1629 Sorting Integers (SUM of M)
|
ユーザー |
|
提出日時 | 2021-07-30 20:59:55 |
言語 | PyPy3 (7.3.15) |
結果 |
TLE
|
実行時間 | - |
コード長 | 453 bytes |
コンパイル時間 | 162 ms |
コンパイル使用メモリ | 82,560 KB |
実行使用メモリ | 260,480 KB |
最終ジャッジ日時 | 2024-09-15 21:20:37 |
合計ジャッジ時間 | 4,561 ms |
ジャッジサーバーID (参考情報) |
judge6 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | TLE * 1 -- * 13 |
ソースコード
import typing from itertools import ( permutations, ) 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] perms = set(permutations(a)) s = [0] * n for p in perms: for i in range(n): s[i] += p[i] s[i] %= mod d = 1 tot = 0 for i in range(n): tot += d * s[i] d *= 10 print(tot % mod) main()