結果

問題 No.282 おもりと天秤(2)
ユーザー mamekinmamekin
提出日時 2016-02-06 01:41:12
言語 C++11
(gcc 11.4.0)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 1,220 bytes
コンパイル時間 671 ms
コンパイル使用メモリ 90,188 KB
実行使用メモリ 24,228 KB
平均クエリ数 917.12
最終ジャッジ日時 2023-09-23 23:09:34
合計ジャッジ時間 16,571 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 97 ms
23,988 KB
testcase_01 AC 710 ms
23,388 KB
testcase_02 AC 467 ms
23,364 KB
testcase_03 AC 389 ms
23,256 KB
testcase_04 AC 330 ms
23,496 KB
testcase_05 AC 596 ms
23,640 KB
testcase_06 AC 753 ms
23,616 KB
testcase_07 AC 323 ms
24,024 KB
testcase_08 AC 737 ms
23,232 KB
testcase_09 AC 140 ms
23,796 KB
testcase_10 AC 3,747 ms
24,228 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){
        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[2*i], a[2*i+1]);
            }
        }
        else{
            for(int i=0; i<(n-1)/2; ++i){
                if(c[i] == '>')
                    swap(a[2*i+1], a[2*i+2]);
            }
        }
    }

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

    return 0;
}
0