#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
typedef long long ll;
#include "monster.h"
const int N = 200 + 2;
int cnt[N];
vector<int> Solve(int n) {
for (int i = 0; i < n; ++i)
for (int j = 0; j < i; ++j)
++cnt[Query(i, j) ? i : j];
vector<int> ans(n, 0), vec1, vecn;
for (int i = 0; i < n; ++i) {
if (cnt[i] == n - 1) vecn.push_back(i);
else if (cnt[i] == 1) vec1.push_back(i);
else ans[cnt[i]] = i;
}
if (Query(vec1[0], vec1[1]))
ans[vec1[0]] = 0, ans[vec1[1]] = 1;
else ans[vec1[0]] = 1, ans[vec1[1]] = 0;
if (Query(vecn[0], vecn[1]))
ans[vecn[0]] = n - 1, ans[vec1[1]] = n;
else ans[vec1[0]] = n, ans[vec1[1]] = n - 1;
return ans;
}
/** /\_/\
* (= ._.)
* / >0 \>1
**/
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1 ms |
328 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1 ms |
328 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
127 ms |
320 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |