結果

問題 No.282 おもりと天秤(2)
ユーザー koyoprokoyopro
提出日時 2015-10-25 17:19:11
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 1,970 ms / 5,000 ms
コード長 785 bytes
コンパイル時間 2,871 ms
コンパイル使用メモリ 145,536 KB
実行使用メモリ 24,300 KB
平均クエリ数 601.00
最終ジャッジ日時 2023-09-23 21:55:15
合計ジャッジ時間 24,733 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 43 ms
23,652 KB
testcase_01 AC 188 ms
23,700 KB
testcase_02 AC 130 ms
24,300 KB
testcase_03 AC 111 ms
23,412 KB
testcase_04 AC 88 ms
23,652 KB
testcase_05 AC 150 ms
23,364 KB
testcase_06 AC 196 ms
23,664 KB
testcase_07 AC 86 ms
24,012 KB
testcase_08 AC 209 ms
24,000 KB
testcase_09 AC 43 ms
23,364 KB
testcase_10 AC 987 ms
24,252 KB
testcase_11 AC 1,820 ms
24,036 KB
testcase_12 AC 1,026 ms
23,700 KB
testcase_13 AC 1,323 ms
23,640 KB
testcase_14 AC 1,695 ms
24,024 KB
testcase_15 AC 1,870 ms
23,556 KB
testcase_16 AC 496 ms
23,952 KB
testcase_17 AC 1,277 ms
23,400 KB
testcase_18 AC 1,638 ms
23,436 KB
testcase_19 AC 1,617 ms
23,580 KB
testcase_20 AC 1,929 ms
23,460 KB
testcase_21 AC 1,912 ms
23,460 KB
testcase_22 AC 1,970 ms
23,604 KB
testcase_23 AC 42 ms
23,400 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include "bits/stdc++.h"
using namespace std;

#define REP(i, n) for(int i=0; i<(n); i++)

int N,T;
signed main()
{
    cin >> N;
    vector<int> V(N+2, 0);
    REP(i,N) V[i] = (i+1);
    REP(l,600) {
        int d = l % 2;
        cout << "?";
        REP(i,N) {
            if (2*i+1+d < N) {
                int a = V[2*i+d];
                int b = V[2*i+1+d];
                printf(" %d %d", a, b);
            } else {
                printf(" 0 0");
            }
        }
        cout << endl << flush;
        char op;
        REP(i,N) {
            cin >> op;
            if (op == '>') {
                swap(V[2*i+d], V[2*i+1+d]);
            }
        }
    }
    cout << "!";
    REP(i,N) {
        cout << " " << V[i];
    }
    cout << endl << flush;
    return 0;
}
0