結果

問題 No.282 おもりと天秤(2)
ユーザー h_nosonh_noson
提出日時 2016-06-17 20:30:35
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 1,598 ms / 5,000 ms
コード長 976 bytes
コンパイル時間 455 ms
コンパイル使用メモリ 66,736 KB
実行使用メモリ 24,384 KB
平均クエリ数 220.83
最終ジャッジ日時 2023-09-24 00:08:38
合計ジャッジ時間 15,807 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 23 ms
24,012 KB
testcase_01 AC 23 ms
23,412 KB
testcase_02 AC 22 ms
23,448 KB
testcase_03 AC 21 ms
23,400 KB
testcase_04 AC 20 ms
23,412 KB
testcase_05 AC 22 ms
24,180 KB
testcase_06 AC 24 ms
24,264 KB
testcase_07 AC 20 ms
23,568 KB
testcase_08 AC 28 ms
23,388 KB
testcase_09 AC 22 ms
23,676 KB
testcase_10 AC 413 ms
23,568 KB
testcase_11 AC 1,399 ms
23,388 KB
testcase_12 AC 452 ms
23,676 KB
testcase_13 AC 708 ms
23,976 KB
testcase_14 AC 1,195 ms
23,676 KB
testcase_15 AC 1,461 ms
23,556 KB
testcase_16 AC 95 ms
24,384 KB
testcase_17 AC 635 ms
24,024 KB
testcase_18 AC 1,158 ms
23,376 KB
testcase_19 AC 1,035 ms
24,000 KB
testcase_20 AC 1,598 ms
23,412 KB
testcase_21 AC 1,533 ms
24,276 KB
testcase_22 AC 1,575 ms
23,964 KB
testcase_23 AC 20 ms
24,264 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <map>
#include <algorithm>
using namespace std;

#define REP(i,s,e) for (i = s; i <= e; i++)
#define rep(i,n) REP (i,0,(int)(n)-1)
#define RREP(i,s,e) for (i = s; i >= e; i--)
#define rrep(i,n) RREP (i,(int)(n)-1,0)
#define INF (int)1e8
#define MOD (int)(1e9+7)

typedef long long ll;

int main(void) {
    int n;
    cin >> n;

    int i, j;
    int ans[500];
    rep (i,n) ans[i] = i+1;
    rep (i,n) {
        cout << "? ";
        int rest = n;
        for (j = i % 2; j < n-1; j+=2,rest--)
            cout << ans[j] << " " << ans[j+1] << " ";
        while (rest--)
            cout << "0 0 ";
        cout << endl;
        rest = n;
        char c;
        for (j = i % 2; j < n-1; j+=2,rest--) {
            cin >> c;
            if (c == '>')
                swap(ans[j],ans[j+1]);
        }
        while (rest--) cin >> c;
    }
    cout << "! ";
    rep (i,n) cout << ans[i] << " ";
    cout << endl;
    return 0;
}
0