結果
問題 |
No.1619 Coccinellidae
|
ユーザー |
|
提出日時 | 2021-07-22 23:07:21 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 501 bytes |
コンパイル時間 | 214 ms |
コンパイル使用メモリ | 82,432 KB |
実行使用メモリ | 86,784 KB |
最終ジャッジ日時 | 2024-07-17 19:46:58 |
合計ジャッジ時間 | 2,966 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 13 WA * 3 |
ソースコード
from collections import deque n,m,k = map(int,input().split()) ans = [i for i in range(n-1)] ans.append(m-sum(ans)) ans2 = deque(ans) now = 0 while True: if n-1-now < k: ans2.appendleft(ans2.pop()) k -= n-1-now now += 1 else: ans3 = [] for i in range(now): ans3.append(ans[-1-i]) for i in range(now,n): ans3.append(ans[i-now]) ans3.insert(-k,ans3.pop()) for i in ans3: print(i) exit()