結果

問題 No.1619 Coccinellidae
ユーザー AEnAEn
提出日時 2022-08-31 13:23:34
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 373 bytes
コンパイル時間 296 ms
コンパイル使用メモリ 82,104 KB
実行使用メモリ 81,392 KB
最終ジャッジ日時 2024-04-25 17:55:10
合計ジャッジ時間 3,590 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
54,436 KB
testcase_01 WA -
testcase_02 AC 71 ms
81,224 KB
testcase_03 AC 38 ms
54,484 KB
testcase_04 WA -
testcase_05 AC 69 ms
79,132 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 66 ms
79,212 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 68 ms
79,548 KB
testcase_12 AC 37 ms
54,140 KB
testcase_13 WA -
testcase_14 AC 73 ms
81,392 KB
testcase_15 AC 37 ms
54,148 KB
testcase_16 AC 38 ms
54,812 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import deque
N, M, K = map(int, input().split())
d = deque()
for i in range(N):
    if i<N-1:
        d.append(i+1)
        M -= i+1
    else:
        d.append(M)

res = [0]*N
for i in range(N):
    n = N-i-1
    if K>=n:
        v = d.popleft()
        res[-1-i] = v
        K -= n
    else:
        v = d.pop()
        res[-1-i] = v
print(*res, sep='\n')
0