結果
| 問題 | No.2085 Directed Complete Graph |
| ユーザー |
259_Momone
|
| 提出日時 | 2022-09-27 01:05:30 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 969 bytes |
| 記録 | |
| コンパイル時間 | 2,365 ms |
| コンパイル使用メモリ | 290,888 KB |
| 実行使用メモリ | 30,032 KB |
| 平均クエリ数 | 2949.88 |
| 最終ジャッジ日時 | 2026-06-27 18:52:49 |
| 合計ジャッジ時間 | 3,910 ms |
|
ジャッジサーバーID (参考情報) |
judge2_1 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 1 WA * 14 |
ソースコード
#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);
mt19937_64 mt{random_device{}()};
const auto cmp{[](unsigned long x){
return [x](unsigned long y) -> bool {
if(x == y)return 0;
cout << "? " << y << " " << x << endl;
unsigned long t;
cin >> t;
return t;
};
}};
[rec_impl{[&A, &mt, &cmp](auto&& f, unsigned long l, unsigned long r) -> void {
while(l + 1 < r){
unsigned long d{uniform_int_distribution<unsigned long>{l, r - 1}(mt)};
const auto m{partition(begin(A) + l, begin(A) + r, cmp(A[d])) - begin(A)};
f(f, l, m);
l = m + 1;
}
}}, &N]{rec_impl(rec_impl, 0, N);}();
cout << "!" << endl;
cout << N - 1 << endl;
for(const auto a : A)cout << a << " ";
cout << endl;
return 0;
}
259_Momone