結果
問題 | No.1831 Parasol |
ユーザー |
![]() |
提出日時 | 2022-02-04 23:24:53 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 941 bytes |
コンパイル時間 | 2,136 ms |
コンパイル使用メモリ | 200,176 KB |
最終ジャッジ日時 | 2025-01-27 19:55:07 |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 1 |
other | WA * 19 |
ソースコード
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; priority_queue<pair<int,int>>que; for(int i = 1; i < 2*N; i++) { que.push({i,-i}); } cout << 2*N-1 << endl; int res = 0; for(int i = 1; i < 2*N; i++) { for(int j = 1; j <= min(2,i); j++) { res++; vector<int>ans; vector<int>tmp; ans.push_back(i); for(int k = 1; k < N; k++) { pair<int,int> x = que.top(); que.pop(); tmp.push_back(x.first); ans.push_back(-x.second); } for(int k = 0; k < tmp.size(); k++) { que.push({tmp[k]-1,-ans[k+1]}); } for(int k = 0; k < N; k++) { cout << ans[k] << ((k+1 == N)?"\n":" "); } if(res == 2*N-1) { return 0; } } } }