結果

問題 No.282 おもりと天秤(2)
ユーザー SugarDragon5SugarDragon5
提出日時 2017-09-27 09:09:40
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,018 bytes
コンパイル時間 1,460 ms
コンパイル使用メモリ 167,168 KB
実行使用メモリ 31,560 KB
平均クエリ数 834.25
最終ジャッジ日時 2023-09-23 14:32:45
合計ジャッジ時間 18,167 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 27 ms
23,580 KB
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 WA -
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;
#define vi vector<int>
#define vvi vector<vi>
#define vs vector<string>
#define pb push_back
#define P pair<int,int>
#define vp vector<P>
#define PP pair<P,int>
#define vpp vector<PP>
#define fi first
#define se second
#define INF (1<<30)
#define MOD 1000000007
#define REP(i,n) for(int i=0;i<n;i++)
#define REPR(i,n) for(int i=n;i>=0;i--)
#define FOR(i,m,n) for(int i=m;i<n;i++)
#define all(x) (x).begin(),(x).end()
int main(){
    int n;
    cin>>n;
    vi vec(n);
    REP(i,n)vec[i]=i+1;
    while(1){
        bool f=false;
        cout<<"?";
        REP(i,n){
            cout<<" "<<vec[i];
        }
        REP(i,n){
            cout<<" "<<0;
        }cout<<endl;

        REP(i,n){
            string t;
            cin>>t;
            if(t==">"&&i<n/2){
                swap(vec[i/2],vec[i/2+1]);
                f=true;
            }
        }
        if(!f)break;
    }
    cout<<"!";
    REP(i,n){
        cout<<" "<<vec[i];
    }
    cout<<endl;
    return 0;
}
0