結果

問題 No.2085 Directed Complete Graph
ユーザー 259_Momone259_Momone
提出日時 2022-09-27 01:07:53
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 522 bytes
コンパイル時間 4,520 ms
コンパイル使用メモリ 268,488 KB
実行使用メモリ 24,348 KB
平均クエリ数 2459.88
最終ジャッジ日時 2023-08-24 03:23:22
合計ジャッジ時間 6,254 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
24,312 KB
testcase_01 AC 25 ms
24,348 KB
testcase_02 WA -
testcase_03 AC 163 ms
24,288 KB
testcase_04 WA -
testcase_05 AC 82 ms
23,988 KB
testcase_06 AC 85 ms
23,556 KB
testcase_07 AC 148 ms
23,580 KB
testcase_08 AC 113 ms
23,976 KB
testcase_09 AC 147 ms
23,436 KB
testcase_10 AC 152 ms
24,276 KB
testcase_11 AC 153 ms
23,412 KB
testcase_12 AC 151 ms
23,580 KB
testcase_13 AC 151 ms
23,844 KB
testcase_14 AC 154 ms
23,640 KB
testcase_15 AC 26 ms
23,856 KB
testcase_16 AC 25 ms
24,084 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/extc++.h>

int main() {
    using namespace std;
    unsigned long N;
    cin >> N;
    vector<unsigned long> A(N);
    iota(begin(A), end(A), 1);
    shuffle(begin(A), end(A), mt19937_64{random_device{}()});
    stable_sort(begin(A), end(A), [](auto i, auto j){
        cout << "? " << i << " " << j << endl;
        unsigned long x;
        cin >> x;
        return x;
    });
    cout << "!" << endl;
    cout << N - 1 << endl;
    for(const auto a : A)cout << a << " ";
    cout << endl;
    return 0;
}
0