結果
問題 | No.1619 Coccinellidae |
ユーザー |
![]() |
提出日時 | 2021-07-22 21:47:42 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 134 ms / 2,000 ms |
コード長 | 780 bytes |
コンパイル時間 | 1,903 ms |
コンパイル使用メモリ | 171,576 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-07-17 17:14:09 |
合計ジャッジ時間 | 4,309 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 16 |
ソースコード
#include <bits/stdc++.h> using namespace std; #define ll long long #define rep(i,n) for(int (i)=0;(i)<(n);(i)++) #define Pr pair<ll,ll> #define Tp tuple<ll,ll,ll> using Graph = vector<vector<int>>; const ll mod = 998244353; int main() { ll N,M,K; cin >> N >> M >> K; ll r = M-N*(N-1)/2; vector<ll> perm; rep(i,N){ perm.push_back(i); } perm[N-1] += r; vector<ll> fr; bool tr[N]; rep(i,N) tr[i] = false; ll inv = 0; rep(i,N){ if(inv+(N-1-i)<=K){ inv += (N-1-i); fr.push_back(perm[N-1-i]); tr[N-1-i] = true; } } rep(i,fr.size()){ cout << fr[i] << endl; } rep(i,N){ if(tr[i]) continue; cout << perm[i] << endl; } //cout << endl; }