結果
| 問題 |
No.2027 (1, 2, 3, …, N) 's Subset Sum
|
| コンテスト | |
| ユーザー |
Schnee
|
| 提出日時 | 2022-08-18 00:47:41 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 212 bytes |
| コンパイル時間 | 190 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 17,444 KB |
| 最終ジャッジ日時 | 2024-10-05 07:40:01 |
| 合計ジャッジ時間 | 4,117 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | TLE * 1 -- * 24 |
ソースコード
n,s = map(int, input().split())
for i in range(s+1, 1 << n):
sub = [j+1 for j in range(n) if (i >> j) & 1]
if sum(sub) == s:
print(len(sub))
print(*sub)
break
else:
print(-1)
Schnee