結果

問題 No.282 おもりと天秤(2)
ユーザー izuru_matsuuraizuru_matsuura
提出日時 2016-06-15 15:21:28
言語 C++11
(gcc 11.4.0)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 1,032 bytes
コンパイル時間 1,018 ms
コンパイル使用メモリ 147,552 KB
実行使用メモリ 24,384 KB
平均クエリ数 917.12
最終ジャッジ日時 2023-09-24 00:09:15
合計ジャッジ時間 15,760 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 88 ms
23,436 KB
testcase_01 AC 627 ms
24,048 KB
testcase_02 AC 403 ms
23,676 KB
testcase_03 AC 334 ms
23,676 KB
testcase_04 AC 286 ms
24,036 KB
testcase_05 AC 528 ms
23,868 KB
testcase_06 AC 650 ms
23,436 KB
testcase_07 AC 280 ms
23,568 KB
testcase_08 AC 649 ms
23,664 KB
testcase_09 AC 125 ms
24,384 KB
testcase_10 AC 3,338 ms
8,168 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 <bits/stdc++.h>

using namespace std;

namespace {
    int N;
    void input() {
        cin >> N;
    }

    void solve() {
        vector<int> F;
        for (int i = 1; i <= N; i++) F.push_back(i);
        for (int k = 0, t = 0; k < 2000; k++, t = !t) {
            cout << "?";
            int c = 0;
            for (int i = t; i + 1 < N; i += 2) {
                cout << " " << F[i] << " " << F[i + 1];
                c++;
            }
            for (int j = c; j < N; j++) {
                cout << " 0 0";
            }
            cout << endl;

            for (int i = t; i + 1 < N; i += 2) {
                string x; cin >> x;
                if (x == ">") {
                    swap(F[i], F[i + 1]);
                }
            }
            for (int i = c; i < N; i++) {
                string x; cin >> x;
            }
        }
        cout << "!";
        for (int i = 0; i < N; i++) {
            cout << " " << F[i];
        }
        cout << endl;
    }
}

int main() {
    input(); solve();
}
0