結果
問題 | No.1619 Coccinellidae |
ユーザー |
|
提出日時 | 2024-12-06 09:34:35 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 558 bytes |
コンパイル時間 | 3,399 ms |
コンパイル使用メモリ | 256,372 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-06 09:34:42 |
合計ジャッジ時間 | 6,859 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 9 WA * 7 |
ソースコード
#include <bits/stdc++.h>using namespace std;using ll = long long;int main() {ios::sync_with_stdio(false);cin.tie(nullptr);ll N, M, K;cin >> N >> M >> K;vector<ll> v;for(ll i = N; i--;) {if(K >= i) {v.emplace_back(i + 1);K -= i;}}vector<ll> ans(v);ranges::reverse(v);for(ll i = 1; i <= N; i++) {if(!ranges::binary_search(v, i)) { ans.emplace_back(i); }}for(ll i = 0; i < N; i++) {if(ans[i] == N) { ans[i] += M - N * (N + 1) / 2; }}for(auto &i : ans) { cout << i << "\n"; }}