結果

問題 No.282 おもりと天秤(2)
ユーザー mamekinmamekin
提出日時 2016-02-06 01:35:51
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 1,212 bytes
コンパイル時間 692 ms
コンパイル使用メモリ 91,916 KB
実行使用メモリ 24,444 KB
平均クエリ数 917.12
最終ジャッジ日時 2023-09-23 08:51:02
合計ジャッジ時間 17,052 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 94 ms
24,084 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 <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){
        cout << '?';
        for(int i=0; i<n; ++i)
            cout << ' ' << a[(i+t%2)%n];
        for(int i=0; i<n; ++i)
            cout << ' ' << 0;
        cout << endl;

        string c(n, ' ');
        for(int i=0; i<n; ++i)
            cin >> c[i];

        if(t % 2 == 0){
            for(int i=0; i<n/2; ++i){
                if(c[i] == '>')
                    swap(a[i], a[i+1]);
            }
        }
        else{
            for(int i=0; i<(n-1)/2; ++i){
                if(c[i] == '>')
                    swap(a[i+1], a[i+2]);
            }
        }
    }

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

    return 0;
}
0