#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 - 2) 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 - 2, ans[vecn[1]] = n - 1;
else ans[vecn[0]] = n - 1, ans[vecn[1]] = n - 2;
return ans;
}
/** /\_/\
* (= ._.)
* / >0 \>1
**/
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
200 KB |
Output is correct |
2 |
Correct |
1 ms |
200 KB |
Output is correct |
3 |
Correct |
1 ms |
200 KB |
Output is correct |
4 |
Incorrect |
1 ms |
200 KB |
Wrong Answer [3] |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
200 KB |
Output is correct |
2 |
Correct |
1 ms |
200 KB |
Output is correct |
3 |
Correct |
1 ms |
200 KB |
Output is correct |
4 |
Incorrect |
1 ms |
200 KB |
Wrong Answer [3] |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
199 ms |
404 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |