結果

問題 No.1619 Coccinellidae
ユーザー AEnAEn
提出日時 2022-08-31 13:27:02
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 432 bytes
コンパイル時間 151 ms
コンパイル使用メモリ 82,152 KB
実行使用メモリ 81,024 KB
最終ジャッジ日時 2024-04-25 18:01:22
合計ジャッジ時間 2,136 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
54,232 KB
testcase_01 WA -
testcase_02 AC 70 ms
81,024 KB
testcase_03 AC 36 ms
55,304 KB
testcase_04 WA -
testcase_05 AC 64 ms
79,132 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 66 ms
79,272 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 69 ms
79,752 KB
testcase_12 AC 37 ms
54,168 KB
testcase_13 WA -
testcase_14 AC 73 ms
80,988 KB
testcase_15 AC 37 ms
54,284 KB
testcase_16 AC 36 ms
55,264 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)
if M<N:
    exit(print(0))

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
if K==0:
    print(*res, sep='\n')
else:
    print(0)
0