結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 41 ms
55,436 KB
testcase_01 WA -
testcase_02 AC 78 ms
81,240 KB
testcase_03 AC 41 ms
53,740 KB
testcase_04 WA -
testcase_05 AC 73 ms
79,124 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 71 ms
79,004 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 74 ms
79,696 KB
testcase_12 AC 41 ms
54,736 KB
testcase_13 WA -
testcase_14 AC 79 ms
81,164 KB
testcase_15 AC 41 ms
55,252 KB
testcase_16 AC 41 ms
54,472 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