結果
| 問題 | No.1632 Sorting Integers (GCD of M) |
| コンテスト | |
| ユーザー |
nok0
|
| 提出日時 | 2021-07-30 21:30:35 |
| 言語 | PyPy3 (7.3.23 + ACL) |
| 結果 |
TLE
不安定
|
| 実行時間 | - |
| コード長 | 612 bytes |
| 記録 | |
| コンパイル時間 | 485 ms |
| コンパイル使用メモリ | 96,104 KB |
| 実行使用メモリ | 82,944 KB |
| 最終ジャッジ日時 | 2026-08-28 07:53:20 |
| 合計ジャッジ時間 | 5,129 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 TLE * 1 |
| other | -- * 59 |
ソースコード
from math import gcd
mod = 10 ** 9 + 7
n = int(input())
c = list(map(int, input().split()))
g = 0
for i in range(9):
for j in range(i + 1, 9):
if c[i] and c[j]:
g = gcd(g, 9 * (j - i))
res = 0
if g == 0:
x = 0
for i in range(9):
for j in range(c[i]):
x *= 10
x += i + 1
x %= mod
print(x)
exit()
for k in range(1, g + 1):
if g % k:
continue
x = 0
for i in range(9):
for j in range(c[i]):
x *= 10
x += i + 1
x %= k
if x == 0:
res = k
print(res % mod)
nok0