結果
問題 |
No.282 おもりと天秤(2)
|
ユーザー |
![]() |
提出日時 | 2020-01-27 15:47:06 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 1,832 ms / 5,000 ms |
コード長 | 772 bytes |
コンパイル時間 | 1,882 ms |
コンパイル使用メモリ | 195,080 KB |
最終ジャッジ日時 | 2025-01-08 20:41:11 |
ジャッジサーバーID (参考情報) |
judge2 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 24 |
ソースコード
#include<bits/stdc++.h> using namespace std; using Int = long long; template<typename T1,typename T2> inline void chmin(T1 &a,T2 b){if(a>b) a=b;} template<typename T1,typename T2> inline void chmax(T1 &a,T2 b){if(a<b) a=b;} //INSERT ABOVE HERE signed main(){ int n; cin>>n; vector<int> ans(n); for(int i=0;i<n;i++) ans[i]=i+1; for(int t=0;t<500;t++){ cout<<"?"; int c=n; for(int i=t&1;i+1<n;i+=2){ cout<<" "<<ans[i]; cout<<" "<<ans[i+1]; c--; } while(c--) cout<<" "<<0<<" "<<0; cout<<endl; c=n; string x; for(int i=t&1;i+1<n;i+=2){ cin>>x; if(x==">") swap(ans[i],ans[i+1]); c--; } while(c--) cin>>x; } cout<<"!"; for(int x:ans) cout<<" "<<x; cout<<endl; return 0; }