#include "monster.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
vector<int> Solve(int N) {
vector<int> T(N), cnt(N);
for (int i=0;i<N-1;i++){
for (int j=i+1;j<N;j++){
bool tmp = Query(i, j);
if (tmp) cnt[i]++;
else cnt[j]++;
}
}
vector<int> tmp1, tmpn;
for (int i=0;i<N;i++){
if (cnt[i]>1 && cnt[i]<N-2) T[i] = cnt[i];
else if (cnt[i]==1) tmp1.push_back(i);
else tmpn.push_back(i);
}
if (Query(tmp1[0], tmp1[1]))T[tmp1[0]] = 0, T[tmp1[1]] = 1;
else T[tmp1[0]] = 1, T[tmp1[1]] = 0;
if (Query(tmpn[0], tmpn[1])) T[tmpn[0]] = N-2, T[tmpn[1]] = N-1;
else T[tmpn[0]] = N-1, T[tmpn[1]] = N-2;
return T;
}
# |
결과 |
실행 시간 |
메모리 |
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 |
Correct |
1 ms |
200 KB |
Output is correct |
5 |
Correct |
1 ms |
200 KB |
Output is correct |
6 |
Correct |
1 ms |
200 KB |
Output is correct |
7 |
Correct |
1 ms |
200 KB |
Output is correct |
8 |
Correct |
1 ms |
200 KB |
Output is correct |
9 |
Correct |
1 ms |
200 KB |
Output is correct |
10 |
Correct |
1 ms |
200 KB |
Output is correct |
11 |
Correct |
1 ms |
200 KB |
Output is correct |
12 |
Correct |
1 ms |
200 KB |
Output is correct |
13 |
Correct |
1 ms |
200 KB |
Output is correct |
14 |
Correct |
1 ms |
200 KB |
Output is correct |
15 |
Correct |
1 ms |
200 KB |
Output is correct |
16 |
Correct |
217 ms |
200 KB |
Output is correct |
17 |
Correct |
209 ms |
200 KB |
Output is correct |
18 |
Correct |
192 ms |
200 KB |
Output is correct |
19 |
Correct |
209 ms |
200 KB |
Output is correct |
20 |
Correct |
194 ms |
200 KB |
Output is correct |
21 |
Correct |
1 ms |
200 KB |
Output is correct |
22 |
Correct |
0 ms |
200 KB |
Output is correct |
23 |
Correct |
1 ms |
200 KB |
Output is correct |
24 |
Correct |
1 ms |
200 KB |
Output is correct |
25 |
Correct |
1 ms |
200 KB |
Output is correct |
26 |
Correct |
271 ms |
200 KB |
Output is correct |
27 |
Correct |
1 ms |
200 KB |
Output is correct |
28 |
Correct |
1 ms |
200 KB |
Output is correct |
29 |
Correct |
1 ms |
200 KB |
Output is correct |
30 |
Correct |
1 ms |
200 KB |
Output is correct |
31 |
Correct |
1 ms |
200 KB |
Output is correct |
32 |
Correct |
166 ms |
200 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
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 |
Correct |
1 ms |
200 KB |
Output is correct |
5 |
Correct |
1 ms |
200 KB |
Output is correct |
6 |
Correct |
1 ms |
200 KB |
Output is correct |
7 |
Correct |
1 ms |
200 KB |
Output is correct |
8 |
Correct |
1 ms |
200 KB |
Output is correct |
9 |
Correct |
1 ms |
200 KB |
Output is correct |
10 |
Correct |
1 ms |
200 KB |
Output is correct |
11 |
Correct |
1 ms |
200 KB |
Output is correct |
12 |
Correct |
1 ms |
200 KB |
Output is correct |
13 |
Correct |
1 ms |
200 KB |
Output is correct |
14 |
Correct |
1 ms |
200 KB |
Output is correct |
15 |
Correct |
1 ms |
200 KB |
Output is correct |
16 |
Correct |
217 ms |
200 KB |
Output is correct |
17 |
Correct |
209 ms |
200 KB |
Output is correct |
18 |
Correct |
192 ms |
200 KB |
Output is correct |
19 |
Correct |
209 ms |
200 KB |
Output is correct |
20 |
Correct |
194 ms |
200 KB |
Output is correct |
21 |
Correct |
1 ms |
200 KB |
Output is correct |
22 |
Correct |
0 ms |
200 KB |
Output is correct |
23 |
Correct |
1 ms |
200 KB |
Output is correct |
24 |
Correct |
1 ms |
200 KB |
Output is correct |
25 |
Correct |
1 ms |
200 KB |
Output is correct |
26 |
Correct |
271 ms |
200 KB |
Output is correct |
27 |
Correct |
1 ms |
200 KB |
Output is correct |
28 |
Correct |
1 ms |
200 KB |
Output is correct |
29 |
Correct |
1 ms |
200 KB |
Output is correct |
30 |
Correct |
1 ms |
200 KB |
Output is correct |
31 |
Correct |
1 ms |
200 KB |
Output is correct |
32 |
Correct |
166 ms |
200 KB |
Output is correct |
33 |
Incorrect |
256 ms |
276 KB |
Wrong Answer [6] |
34 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
215 ms |
280 KB |
Wrong Answer [6] |
2 |
Halted |
0 ms |
0 KB |
- |