結果
| 問題 |
No.689 E869120 and Constructing Array 3
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-05-19 00:39:30 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 442 bytes |
| コンパイル時間 | 118 ms |
| コンパイル使用メモリ | 12,672 KB |
| 実行使用メモリ | 11,008 KB |
| 最終ジャッジ日時 | 2024-06-28 14:13:31 |
| 合計ジャッジ時間 | 4,874 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 3 |
| other | AC * 4 WA * 9 |
ソースコード
from math import factorial
c = lambda y, x: factorial(y) // factorial(x) // factorial(y - x)
def solve():
k = int(input())
if k <= 250:
return [1] + [4] * (k - 1)
for i in range(2, 251):
for j in range(2, 251 - i):
if i * j + c(i, 2) == k:
return [1] * i + [4] * j
if c(i, 2) == k:
return [2] * i + [3] * j
return [0]
v = solve()
print(len(v))
print(*v)