結果

問題 No.282 おもりと天秤(2)
ユーザー kzyKTkzyKT
提出日時 2015-09-19 00:15:15
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 2,538 bytes
コンパイル時間 3,823 ms
コンパイル使用メモリ 151,300 KB
実行使用メモリ 24,420 KB
平均クエリ数 445.92
最終ジャッジ日時 2023-09-23 06:09:05
合計ジャッジ時間 18,063 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 TLE -
testcase_11 -- -
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;
#define all(c) (c).begin(),(c).end()
#define rrep(i,n) for(int i=(int)(n)-1;i>=0;i--)
#define REP(i,m,n) for(int i=(int)(m);i<(int)(n);i++)
#define rep(i,n) REP(i,0,n)
#define iter(c) __typeof((c).begin())
#define tr(it,c) for(iter(c) it=(c).begin();it!=(c).end();it++)
#define mem(a) memset(a,0,sizeof(a))
#define pd(a) printf("%.10f\n",a)
#define pb(a) push_back(a)
#define in(a) insert(a)
#define pi M_PI
#define R cin>>
#define F first
#define S second
#define C class
#define ll long long
#define ln cout<<'\n'
#define _(_1,_2,_3,N,...)N
#define pr(...) _(__VA_ARGS__,pr3,pr2,pr1)(__VA_ARGS__)
template<C T>void pr1(T a){cout<<a;ln;}
template<C T,C T2>void pr2(T a,T2 b){cout<<a<<' '<<b;ln;}
template<C T,C T2,C T3>void pr3(T a,T2 b,T3 c){cout<<a<<' '<<b<<' '<<c;ln;}
template<C T>void PR(T a,int n){rep(i,n){if(i)cout<<' ';cout<<a[i];}ln;}
bool check(int n,int m,int x,int y){return x>=0&&x<n&&y>=0&&y<m;}
const ll MAX=1000000007,MAXL=1LL<<60,dx[4]={-1,0,1,0},dy[4]={0,1,0,-1};
typedef pair<int,int> P;

void Main() {
  int n;
  cin >> n;
  deque<int> que[2*n],que2[2*n];
  for(int i=0; i<n; i++) que[i].pb(i+1);
  rep(k,n) {
    rep(j,n) {
      cout << "? ";
      cout.flush();
      P a[n];
      rep(i,n) {
        if(i) {
          cout << " ";
          cout.flush();
        }
        if(que[i*2].size()) {
          cout << que[i*2].front();
          a[i].F=que[i*2].front();
          que[i*2].pop_front();
        } else {
          cout << "0";
          a[i].F=0;
        }
        cout.flush();
        cout << " ";
        cout.flush();
        if(que[i*2+1].size()) {
          cout << que[i*2+1].front();
          a[i].S=que[i*2+1].front();
          que[i*2+1].pop_front();
        } else {
          cout << "0";
          a[i].S=0;
        }
        cout.flush();
      }
      ln;
      cout.flush();
      rep(i,n) {
        char c;
        cin >> c;
        if(c=='=') continue;
        if(c=='>') {
          que2[i].pb(a[i].F);
          que[i*2+1].push_front(a[i].S);
        } else {
          que2[i].pb(a[i].S);
          que[i*2].push_front(a[i].F);
        }
      }
    }
    for(int i=0; i<2*n; i++) {
      while(que2[i].size()) {
        que[i].pb(que2[i].front());
        que2[i].pop_front();
      }
    }
  }
  cout << "!";
  cout.flush();
  while(!que[0].empty()) {
    cout << " " << que[0].front();
    cout.flush();
    que[0].pop_front();
  }
  ln;
  cout.flush();
}

int main() {
  ios::sync_with_stdio(0);cin.tie(0);
  Main();return 0;
}
0