結果

問題 No.282 おもりと天秤(2)
ユーザー mamekinmamekin
提出日時 2018-03-20 13:28:52
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 1,257 bytes
コンパイル時間 747 ms
コンパイル使用メモリ 101,488 KB
実行使用メモリ 24,444 KB
平均クエリ数 1083.88
最終ジャッジ日時 2023-09-24 01:45:32
合計ジャッジ時間 16,429 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 84 ms
23,532 KB
testcase_01 AC 592 ms
23,808 KB
testcase_02 AC 386 ms
24,252 KB
testcase_03 AC 329 ms
23,400 KB
testcase_04 AC 266 ms
23,808 KB
testcase_05 AC 483 ms
24,348 KB
testcase_06 AC 652 ms
24,264 KB
testcase_07 AC 271 ms
23,652 KB
testcase_08 AC 656 ms
23,652 KB
testcase_09 AC 122 ms
23,376 KB
testcase_10 AC 3,189 ms
23,652 KB
testcase_11 TLE -
testcase_12 AC 3,454 ms
23,352 KB
testcase_13 AC 4,084 ms
24,444 KB
testcase_14 TLE -
testcase_15 TLE -
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)&~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