結果
問題 | No.1619 Coccinellidae |
ユーザー |
![]() |
提出日時 | 2021-07-22 23:19:38 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 497 bytes |
コンパイル時間 | 280 ms |
コンパイル使用メモリ | 82,164 KB |
実行使用メモリ | 71,956 KB |
最終ジャッジ日時 | 2024-07-17 20:09:37 |
合計ジャッジ時間 | 3,932 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 1 |
other | TLE * 1 -- * 15 |
ソースコード
n,m,k = map(int,input().split()) ans = [] for i in range(n): if i == n-1: ans.append(m-(1 + i)*i//2) else: ans.append(i+1) N = n-1 cnt = 1 goukei = 0 while True: if goukei + N > k: break goukei += N N -= 1 cnt += 1 if cnt == 0: ll = [] else: ll = ans[-cnt::] ll.sort(reverse = True) lll = ans[:n-cnt] for j in range(k - goukei): lll[-(j+1)] ,lll[-(j + 2)] = lll[-(j + 2)] ,lll[-(j+1)] ans = ll + lll for i in range(n): print(ans[i])