結果

問題 No.282 おもりと天秤(2)
ユーザー beetbeet
提出日時 2020-01-27 15:45:26
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 773 bytes
コンパイル時間 2,890 ms
コンパイル使用メモリ 200,108 KB
実行使用メモリ 24,432 KB
平均クエリ数 917.12
最終ジャッジ日時 2023-09-24 02:25:33
合計ジャッジ時間 17,867 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 94 ms
24,024 KB
testcase_01 AC 665 ms
23,436 KB
testcase_02 AC 436 ms
24,036 KB
testcase_03 AC 352 ms
23,388 KB
testcase_04 AC 297 ms
24,348 KB
testcase_05 AC 553 ms
23,364 KB
testcase_06 AC 703 ms
24,276 KB
testcase_07 AC 303 ms
24,432 KB
testcase_08 AC 727 ms
23,520 KB
testcase_09 AC 133 ms
23,364 KB
testcase_10 AC 3,675 ms
23,664 KB
testcase_11 TLE -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#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;
}
0