結果
| 問題 |
No.689 E869120 and Constructing Array 3
|
| コンテスト | |
| ユーザー |
tktk_snsn
|
| 提出日時 | 2020-12-09 23:37:57 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,005 bytes |
| コンパイル時間 | 129 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 11,008 KB |
| 最終ジャッジ日時 | 2024-09-19 06:08:34 |
| 合計ジャッジ時間 | 2,499 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 6 WA * 7 |
ソースコード
def main(K):
if K == 0:
print(1, 10, sep="\n")
return
elif K == 1:
print(2, *[1, 1], sep="\n")
return
ok = False
for i in range(1, int(K ** 0.5 + 0.5) + 1):
if K % i == 0 and (i + K // i) <= 250:
ok = True
two, three = i, K // i
break
if ok:
print(two + three)
A = [2] * two + [3] * three
print(*A)
return
one = 2
while True:
x = one * (one - 1) // 2
ok = False
if x > K:
break
tmp = K - x
for i in range(1, int(tmp ** 0.5 + 0.5) + 1):
if tmp % i == 0 and (one + i + tmp // i) <= 250:
ok = True
two, three = i, K // i
break
if ok:
break
one += 1
if ok:
print(one + two + three)
A = [1] * one + [2] * two + [3] * three
print(*A)
return
print(None)
return
K = int(input())
main(K)
tktk_snsn