結果

問題 No.2027 (1, 2, 3, …, N) 's Subset Sum
ユーザー pluto77pluto77
提出日時 2023-01-21 15:48:21
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 152 ms / 2,000 ms
コード長 119 bytes
コンパイル時間 151 ms
コンパイル使用メモリ 10,612 KB
実行使用メモリ 19,252 KB
最終ジャッジ日時 2023-09-06 04:44:42
合計ジャッジ時間 4,988 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,780 KB
testcase_01 AC 15 ms
7,780 KB
testcase_02 AC 144 ms
19,252 KB
testcase_03 AC 14 ms
7,792 KB
testcase_04 AC 152 ms
19,124 KB
testcase_05 AC 145 ms
19,212 KB
testcase_06 AC 151 ms
18,956 KB
testcase_07 AC 40 ms
9,624 KB
testcase_08 AC 114 ms
16,048 KB
testcase_09 AC 36 ms
8,944 KB
testcase_10 AC 66 ms
11,912 KB
testcase_11 AC 40 ms
9,164 KB
testcase_12 AC 49 ms
10,492 KB
testcase_13 AC 38 ms
9,996 KB
testcase_14 AC 26 ms
9,196 KB
testcase_15 AC 48 ms
9,564 KB
testcase_16 AC 58 ms
10,888 KB
testcase_17 AC 15 ms
7,812 KB
testcase_18 AC 16 ms
7,936 KB
testcase_19 AC 15 ms
7,772 KB
testcase_20 AC 15 ms
7,836 KB
testcase_21 AC 15 ms
7,780 KB
testcase_22 AC 88 ms
14,344 KB
testcase_23 AC 55 ms
11,384 KB
testcase_24 AC 26 ms
9,112 KB
testcase_25 AC 106 ms
15,652 KB
testcase_26 AC 36 ms
9,944 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,S=map(int,input().split())
A=[]
for i in range(N,0,-1):
 if i<=S:
  A.append(i)
  S-=i
print(len(A))
print(*A[::-1])
0