結果

問題 No.1619 Coccinellidae
ユーザー H3PO4H3PO4
提出日時 2023-09-16 08:54:16
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
RE  
実行時間 -
コード長 393 bytes
コンパイル時間 416 ms
コンパイル使用メモリ 10,660 KB
実行使用メモリ 15,168 KB
最終ジャッジ日時 2023-09-16 08:54:24
合計ジャッジ時間 2,220 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,828 KB
testcase_01 RE -
testcase_02 AC 79 ms
15,100 KB
testcase_03 AC 15 ms
7,840 KB
testcase_04 RE -
testcase_05 AC 45 ms
12,344 KB
testcase_06 RE -
testcase_07 RE -
testcase_08 AC 54 ms
11,924 KB
testcase_09 RE -
testcase_10 RE -
testcase_11 AC 63 ms
12,728 KB
testcase_12 AC 15 ms
7,900 KB
testcase_13 RE -
testcase_14 AC 66 ms
15,168 KB
testcase_15 RE -
testcase_16 AC 15 ms
7,880 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N, M, K = map(int, input().split())

num_cand_arr = list(range(1, N + 1))
num_cand_arr[-1] = M - sum(num_cand_arr[:-1])

assert num_cand_arr[-1] >= N

inv = 0
res = []
for i in range(N - 1, -1, -1):
    if inv + i <= K:
        inv += i
        res.append(num_cand_arr.pop())
    else:
        res.append(num_cand_arr.pop(K - inv))
        break
res.extend(num_cand_arr)
print(*res, sep="\n")
0