結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 88 ms
24,060 KB
testcase_01 AC 635 ms
23,544 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 536 ms
24,060 KB
testcase_06 AC 678 ms
23,652 KB
testcase_07 WA -
testcase_08 AC 676 ms
23,676 KB
testcase_09 AC 129 ms
23,424 KB
testcase_10 AC 3,285 ms
23,976 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-2)&~1); ++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