結果
問題 |
No.282 おもりと天秤(2)
|
ユーザー |
![]() |
提出日時 | 2018-11-11 21:15:47 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
TLE
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 773 bytes |
コンパイル時間 | 2,136 ms |
コンパイル使用メモリ | 197,256 KB |
最終ジャッジ日時 | 2025-01-06 16:25:55 |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 14 TLE * 10 |
ソースコード
#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<2000;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; }