結果

問題 No.282 おもりと天秤(2)
ユーザー beetbeet
提出日時 2020-01-27 15:47:06
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 1,752 ms / 5,000 ms
コード長 772 bytes
コンパイル時間 2,033 ms
コンパイル使用メモリ 201,576 KB
実行使用メモリ 24,276 KB
平均クエリ数 501.00
最終ジャッジ日時 2023-09-24 02:24:52
合計ジャッジ時間 21,724 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 44 ms
23,376 KB
testcase_01 AC 163 ms
24,276 KB
testcase_02 AC 112 ms
24,012 KB
testcase_03 AC 87 ms
23,952 KB
testcase_04 AC 78 ms
23,520 KB
testcase_05 AC 139 ms
23,376 KB
testcase_06 AC 169 ms
23,532 KB
testcase_07 AC 76 ms
23,664 KB
testcase_08 AC 173 ms
24,204 KB
testcase_09 AC 41 ms
23,520 KB
testcase_10 AC 876 ms
23,640 KB
testcase_11 AC 1,575 ms
24,252 KB
testcase_12 AC 921 ms
23,628 KB
testcase_13 AC 1,077 ms
23,580 KB
testcase_14 AC 1,506 ms
23,388 KB
testcase_15 AC 1,574 ms
23,988 KB
testcase_16 AC 397 ms
23,640 KB
testcase_17 AC 1,026 ms
23,640 KB
testcase_18 AC 1,429 ms
24,000 KB
testcase_19 AC 1,400 ms
23,808 KB
testcase_20 AC 1,621 ms
23,376 KB
testcase_21 AC 1,752 ms
23,796 KB
testcase_22 AC 1,675 ms
23,640 KB
testcase_23 AC 36 ms
24,204 KB
権限があれば一括ダウンロードができます

ソースコード

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