結果

問題 No.1619 Coccinellidae
ユーザー rlangevinrlangevin
提出日時 2023-02-18 00:49:50
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 100 ms / 2,000 ms
コード長 330 bytes
コンパイル時間 463 ms
コンパイル使用メモリ 87,296 KB
実行使用メモリ 84,860 KB
最終ジャッジ日時 2023-09-26 21:53:02
合計ジャッジ時間 4,147 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,620 KB
testcase_01 AC 91 ms
83,048 KB
testcase_02 AC 95 ms
84,408 KB
testcase_03 AC 68 ms
71,312 KB
testcase_04 AC 97 ms
84,600 KB
testcase_05 AC 91 ms
81,416 KB
testcase_06 AC 68 ms
71,120 KB
testcase_07 AC 89 ms
81,724 KB
testcase_08 AC 92 ms
80,320 KB
testcase_09 AC 71 ms
71,416 KB
testcase_10 AC 89 ms
79,940 KB
testcase_11 AC 95 ms
81,628 KB
testcase_12 AC 69 ms
71,308 KB
testcase_13 AC 98 ms
84,860 KB
testcase_14 AC 100 ms
84,852 KB
testcase_15 AC 67 ms
71,472 KB
testcase_16 AC 70 ms
71,484 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N, M, K = map(int, input().split())
if N == 1:
    print(M)
    exit()
    
L = list(range(N - 1))
L.append(M - (N - 1) * (N - 2) // 2)
A, B = [], []
for i in range(N - 1, -1, -1):
    if K >= i and K:
        A.append(L[i])
        K -= i
    else:
        B.append(L[i])
        
B.reverse()
A.extend(B)
for a in A:
    print(a)
0