結果
| 問題 |
No.689 E869120 and Constructing Array 3
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-05-19 00:40:47 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 435 bytes |
| コンパイル時間 | 133 ms |
| コンパイル使用メモリ | 12,416 KB |
| 実行使用メモリ | 10,880 KB |
| 最終ジャッジ日時 | 2024-06-28 14:13:49 |
| 合計ジャッジ時間 | 3,891 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 7 WA * 6 |
ソースコード
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
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)