結果
| 問題 | No.2027 (1, 2, 3, …, N) 's Subset Sum |
| コンテスト | |
| ユーザー |
8nd5t
|
| 提出日時 | 2022-08-05 21:22:40 |
| 言語 | PyPy3 (7.3.23 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 309 ms / 2,000 ms |
| + 200µs | |
| コード長 | 800 bytes |
| 記録 | |
| コンパイル時間 | 232 ms |
| コンパイル使用メモリ | 95,876 KB |
| 実行使用メモリ | 137,652 KB |
| 最終ジャッジ日時 | 2026-08-28 03:57:49 |
| 合計ジャッジ時間 | 10,641 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 25 |
ソースコード
from collections import Counter,defaultdict,deque
from heapq import heappop,heappush,heapify
from bisect import bisect_left,bisect_right
import sys,math,itertools,pprint,fractions
sys.setrecursionlimit(10**8)
mod = 998244353
INF = float('inf')
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpl_1(): return list(map(lambda x:int(x)-1, sys.stdin.readline().split()))
def inplm(): return map(int, sys.stdin.readline().split())
def inpl_1m(): return map(lambda x:int(x)-1, sys.stdin.readline().split())
def err(x): print(x); exit()
n,s = inpl()
if (1+n)*n//2 < s:
print(-1)
else:
res = []
for i in range(1,n+1)[::-1]:
if i <= s:
res.append(i)
s -= i
print(len(res))
print(*res[::-1])
8nd5t