結果
問題 | No.688 E869120 and Constructing Array 2 |
ユーザー | ssmkzk |
提出日時 | 2019-07-04 03:28:46 |
言語 | Python3 (3.12.2 + numpy 1.26.4 + scipy 1.12.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 410 bytes |
コンパイル時間 | 170 ms |
コンパイル使用メモリ | 11,760 KB |
実行使用メモリ | 51,420 KB |
最終ジャッジ日時 | 2023-10-17 18:36:12 |
合計ジャッジ時間 | 5,063 ms |
ジャッジサーバーID (参考情報) |
judge13 / judge12 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | TLE | - |
testcase_01 | -- | - |
testcase_02 | -- | - |
testcase_03 | -- | - |
testcase_04 | -- | - |
testcase_05 | -- | - |
testcase_06 | -- | - |
testcase_07 | -- | - |
testcase_08 | -- | - |
testcase_09 | -- | - |
testcase_10 | -- | - |
testcase_11 | -- | - |
testcase_12 | -- | - |
ソースコード
from scipy.special import comb import sys K = int(input()) if K == 0: print(0) sys.exit() for i in range(2,31): two_ch = comb(i,2,exact=True) for j in range(31-i): ans = 0 for k in range(j+1): one_ch = comb(j,k,exact=True) ans += two_ch * one_ch if ans == K: print(i + j) print("1 "*i + "0 "* j ) sys.exit()