結果

問題 No.2027 (1, 2, 3, …, N) 's Subset Sum
ユーザー 👑 H20H20
提出日時 2022-08-05 21:25:27
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 109 ms / 2,000 ms
コード長 139 bytes
コンパイル時間 1,205 ms
コンパイル使用メモリ 86,776 KB
実行使用メモリ 86,592 KB
最終ジャッジ日時 2023-10-13 21:48:23
合計ジャッジ時間 4,661 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 69 ms
71,268 KB
testcase_01 AC 70 ms
71,216 KB
testcase_02 AC 109 ms
86,408 KB
testcase_03 AC 69 ms
71,292 KB
testcase_04 AC 104 ms
86,592 KB
testcase_05 AC 104 ms
86,200 KB
testcase_06 AC 109 ms
86,200 KB
testcase_07 AC 86 ms
79,784 KB
testcase_08 AC 106 ms
85,244 KB
testcase_09 AC 90 ms
79,744 KB
testcase_10 AC 93 ms
82,088 KB
testcase_11 AC 91 ms
80,264 KB
testcase_12 AC 92 ms
81,144 KB
testcase_13 AC 86 ms
78,024 KB
testcase_14 AC 80 ms
77,140 KB
testcase_15 AC 97 ms
81,468 KB
testcase_16 AC 97 ms
82,084 KB
testcase_17 AC 74 ms
76,456 KB
testcase_18 AC 70 ms
71,444 KB
testcase_19 AC 68 ms
71,512 KB
testcase_20 AC 76 ms
76,676 KB
testcase_21 AC 73 ms
75,284 KB
testcase_22 AC 92 ms
82,192 KB
testcase_23 AC 90 ms
79,988 KB
testcase_24 AC 77 ms
76,868 KB
testcase_25 AC 95 ms
83,152 KB
testcase_26 AC 79 ms
77,580 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,S = map(int, input().split())
v = 1
while S>=v*(v+1)//2:
    v+=1
L = list(range(1,v+1))
L.remove(v*(v+1)//2-S)
print(len(L))
print(*L)

0