結果

問題 No.282 おもりと天秤(2)
ユーザー mamekinmamekin
提出日時 2018-03-20 13:27:42
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,255 bytes
コンパイル時間 812 ms
コンパイル使用メモリ 101,604 KB
実行使用メモリ 24,396 KB
平均クエリ数 917.12
最終ジャッジ日時 2023-09-23 15:59:02
合計ジャッジ時間 16,573 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 92 ms
24,036 KB
testcase_01 AC 652 ms
24,396 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 544 ms
24,336 KB
testcase_06 AC 695 ms
24,300 KB
testcase_07 WA -
testcase_08 AC 683 ms
23,412 KB
testcase_09 AC 129 ms
23,424 KB
testcase_10 AC 3,282 ms
8,116 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 <cstdio>
#include <iostream>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <limits>
#include <climits>
#include <cfloat>
#include <functional>
using namespace std;

int main()
{
    int n;
    cin >> n;
    vector<int> a(n);
    for(int i=0; i<n; ++i)
        a[i] = i + 1;

    for(int t=0; t<2000; ++t){
        vector<int> v(2*n, -1);
        vector<int> b(2*n, 0);
        if(t % 2 == 0){
            for(int i=0; i<(n&~1); ++i){
                v[i] = i;
                b[i] = a[i];
            }
        }
        else{
            for(int i=0; i<(n&~1)-2; ++i){
                v[i] = i + 1;
                b[i] = a[i+1];
            }
        }

        cout << '?';
        for(int i=0; i<2*n; ++i)
            cout << ' ' << b[i];
        cout << endl;

        for(int i=0; i<n; ++i){
            char c;
            cin >> c;
            if(c == '>')
                swap(a[v[2*i]], a[v[2*i+1]]);
        }
    }

    cout << '!';
    for(int i=0; i<n; ++i)
        cout << ' ' << a[i];
    cout << endl;

    return 0;
}
0