結果

問題 No.2027 (1, 2, 3, …, N) 's Subset Sum
ユーザー stngstng
提出日時 2022-08-07 09:18:58
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 79 ms / 2,000 ms
コード長 241 bytes
コンパイル時間 1,147 ms
コンパイル使用メモリ 81,588 KB
実行使用メモリ 96,716 KB
最終ジャッジ日時 2023-10-17 05:15:10
合計ジャッジ時間 5,440 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
53,356 KB
testcase_01 AC 29 ms
53,356 KB
testcase_02 AC 78 ms
96,684 KB
testcase_03 AC 32 ms
53,360 KB
testcase_04 AC 78 ms
96,716 KB
testcase_05 AC 79 ms
96,716 KB
testcase_06 AC 76 ms
96,716 KB
testcase_07 AC 54 ms
80,936 KB
testcase_08 AC 71 ms
93,812 KB
testcase_09 AC 53 ms
80,876 KB
testcase_10 AC 62 ms
86,420 KB
testcase_11 AC 59 ms
82,724 KB
testcase_12 AC 58 ms
84,044 KB
testcase_13 AC 48 ms
76,072 KB
testcase_14 AC 45 ms
67,028 KB
testcase_15 AC 62 ms
85,364 KB
testcase_16 AC 65 ms
86,684 KB
testcase_17 AC 40 ms
61,924 KB
testcase_18 AC 33 ms
53,360 KB
testcase_19 AC 31 ms
53,360 KB
testcase_20 AC 38 ms
62,228 KB
testcase_21 AC 34 ms
58,912 KB
testcase_22 AC 61 ms
86,684 KB
testcase_23 AC 53 ms
81,140 KB
testcase_24 AC 42 ms
66,860 KB
testcase_25 AC 67 ms
89,588 KB
testcase_26 AC 48 ms
72,572 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,s = map(int,input().split())

for i in range(1,n+1):
    tmp = i*(i+1)//2
    if tmp >= s:
        idx = i
        sa = tmp-s
        break
ans = []
for i in range(1,idx+1):
    if i != sa:
        ans.append(i)
print(len(ans))
print(*ans)
0