結果
| 問題 |
No.2085 Directed Complete Graph
|
| ユーザー |
noshi91
|
| 提出日時 | 2022-09-26 22:43:10 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 605 bytes |
| コンパイル時間 | 2,336 ms |
| コンパイル使用メモリ | 203,580 KB |
| 最終ジャッジ日時 | 2025-02-07 16:30:18 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 13 WA * 2 |
ソースコード
#include <bits/stdc++.h>
int main() {
int N;
std::cin >> N;
struct id {
int v;
id &operator=(const id &x) {
v = x.v;
return *this;
}
};
auto comp = [&](id i, id j) {
if (i.v == j.v) {
return false;
}
std::cout << "? " << i.v << " " << j.v << "\n";
int T;
std::cin >> T;
return T == 1;
};
std::vector<id> c(N);
for (int i = 0; i < N; i++) {
c[i].v = i + 1;
}
std::stable_sort(c.begin(), c.end(), comp);
std::cout << "!\n" << N - 1 << "\n";
for (int i = 0; i < N; i++) {
std::cout << c[i].v << " \n"[i + 1 == N];
}
}
noshi91