結果

問題 No.2027 (1, 2, 3, …, N) 's Subset Sum
ユーザー first_vilfirst_vil
提出日時 2022-08-05 21:23:24
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 124 ms / 2,000 ms
コード長 546 bytes
コンパイル時間 304 ms
コンパイル使用メモリ 87,168 KB
実行使用メモリ 99,968 KB
最終ジャッジ日時 2023-10-13 21:44:39
合計ジャッジ時間 4,937 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,428 KB
testcase_01 AC 72 ms
71,520 KB
testcase_02 AC 124 ms
99,828 KB
testcase_03 AC 73 ms
71,284 KB
testcase_04 AC 123 ms
99,844 KB
testcase_05 AC 124 ms
99,968 KB
testcase_06 AC 123 ms
99,772 KB
testcase_07 AC 89 ms
78,716 KB
testcase_08 AC 113 ms
92,784 KB
testcase_09 AC 85 ms
76,724 KB
testcase_10 AC 100 ms
83,932 KB
testcase_11 AC 85 ms
77,624 KB
testcase_12 AC 90 ms
80,104 KB
testcase_13 AC 86 ms
79,240 KB
testcase_14 AC 85 ms
77,016 KB
testcase_15 AC 89 ms
78,756 KB
testcase_16 AC 96 ms
82,288 KB
testcase_17 AC 79 ms
75,656 KB
testcase_18 AC 73 ms
71,432 KB
testcase_19 AC 73 ms
71,548 KB
testcase_20 AC 77 ms
75,740 KB
testcase_21 AC 74 ms
71,220 KB
testcase_22 AC 107 ms
89,404 KB
testcase_23 AC 99 ms
83,364 KB
testcase_24 AC 88 ms
77,268 KB
testcase_25 AC 113 ms
92,508 KB
testcase_26 AC 91 ms
79,116 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

int1 = lambda x: int(x) - 1

# input = lambda: sys.stdin.buffer.readline()
input = lambda: sys.stdin.readline().rstrip()
ii = lambda: int(input())
i1 = lambda: int1(input())
mi = lambda: map(int, input().split())
mi1 = lambda: map(int1, input().split())
li = lambda: list(mi())
li1 = lambda: list(mi1())
lli = lambda n: [li() for _ in range(n)]

INF = float("inf")
mod = int(1e9 + 7)
# mod = 998244353

n, s = mi()
a = []
for i in range(1, n + 1)[::-1]:
    if s >= i:
        s -= i
        a.append(i)
print(len(a))
print(*a[::-1])
0