#include "monster.h"
#include <bits/stdc++.h>
#define elif else if
#define pb push_back
using namespace std;
const int N=205;
int n,s[N],in[N],out[N];
bool b[N][N],adj[N][N];
namespace {
bool example_variable;
} // namespace
int res(int x,int y){
if (abs(x-y)==1) return x<y;
return x>y;
}
std::vector<int> Solve(int N) {
n=N;
for (int i=0;i<n;i++){
for (int j=i+1;j<n;j++){
b[i][j]=Query(i,j);
b[j][i]=!b[i][j];
}
}
if (n==4){
vector<int> a={0,1,2,3};
do{
bool ok=true;
for (int i=0;i<n;i++){
for (int j=i+1;j<n;j++){
if (res(a[i],a[j])==b[i][j]) continue;
ok=false;
}
}
if (!ok) continue;
return a;
}while (next_permutation(a.begin(),a.end()));
}
for (int i=0;i<n;i++){
for (int j=0;j<n;j++){
if (!b[i][j]) continue;
for (int k=0;k<n;k++){
if (!b[i][k] || !b[k][j]) continue;
adj[i][j]=true;
in[j]++;
out[i]++;
break;
}
}
}
for (int i=0;i<n;i++) s[i]=out[i]+1;
for (int i=0;i<n;i++){
for (int j=i+1;j<n;j++){
if (out[i]!=out[j]) continue;
if (in[i]<in[j]) s[j]--;
else s[i]--;
}
}vector<int> ans;
for (int i=0;i<n;i++) ans.pb(s[i]);
return ans;
}
Compilation message
monster.cpp:11:6: warning: '{anonymous}::example_variable' defined but not used [-Wunused-variable]
11 | bool example_variable;
| ^~~~~~~~~~~~~~~~
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
344 KB |
Output is correct |
3 |
Correct |
0 ms |
344 KB |
Output is correct |
4 |
Correct |
0 ms |
344 KB |
Output is correct |
5 |
Correct |
0 ms |
344 KB |
Output is correct |
6 |
Correct |
0 ms |
344 KB |
Output is correct |
7 |
Correct |
0 ms |
344 KB |
Output is correct |
8 |
Correct |
1 ms |
344 KB |
Output is correct |
9 |
Correct |
0 ms |
600 KB |
Output is correct |
10 |
Correct |
0 ms |
344 KB |
Output is correct |
11 |
Correct |
0 ms |
344 KB |
Output is correct |
12 |
Correct |
0 ms |
344 KB |
Output is correct |
13 |
Correct |
0 ms |
344 KB |
Output is correct |
14 |
Correct |
1 ms |
344 KB |
Output is correct |
15 |
Correct |
0 ms |
344 KB |
Output is correct |
16 |
Correct |
98 ms |
1112 KB |
Output is correct |
17 |
Correct |
111 ms |
464 KB |
Output is correct |
18 |
Correct |
95 ms |
456 KB |
Output is correct |
19 |
Correct |
109 ms |
460 KB |
Output is correct |
20 |
Correct |
118 ms |
600 KB |
Output is correct |
21 |
Correct |
0 ms |
344 KB |
Output is correct |
22 |
Correct |
0 ms |
344 KB |
Output is correct |
23 |
Correct |
0 ms |
344 KB |
Output is correct |
24 |
Correct |
0 ms |
344 KB |
Output is correct |
25 |
Correct |
0 ms |
344 KB |
Output is correct |
26 |
Correct |
93 ms |
600 KB |
Output is correct |
27 |
Correct |
1 ms |
344 KB |
Output is correct |
28 |
Correct |
0 ms |
344 KB |
Output is correct |
29 |
Correct |
0 ms |
344 KB |
Output is correct |
30 |
Correct |
0 ms |
344 KB |
Output is correct |
31 |
Correct |
1 ms |
344 KB |
Output is correct |
32 |
Correct |
83 ms |
468 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
344 KB |
Output is correct |
3 |
Correct |
0 ms |
344 KB |
Output is correct |
4 |
Correct |
0 ms |
344 KB |
Output is correct |
5 |
Correct |
0 ms |
344 KB |
Output is correct |
6 |
Correct |
0 ms |
344 KB |
Output is correct |
7 |
Correct |
0 ms |
344 KB |
Output is correct |
8 |
Correct |
1 ms |
344 KB |
Output is correct |
9 |
Correct |
0 ms |
600 KB |
Output is correct |
10 |
Correct |
0 ms |
344 KB |
Output is correct |
11 |
Correct |
0 ms |
344 KB |
Output is correct |
12 |
Correct |
0 ms |
344 KB |
Output is correct |
13 |
Correct |
0 ms |
344 KB |
Output is correct |
14 |
Correct |
1 ms |
344 KB |
Output is correct |
15 |
Correct |
0 ms |
344 KB |
Output is correct |
16 |
Correct |
98 ms |
1112 KB |
Output is correct |
17 |
Correct |
111 ms |
464 KB |
Output is correct |
18 |
Correct |
95 ms |
456 KB |
Output is correct |
19 |
Correct |
109 ms |
460 KB |
Output is correct |
20 |
Correct |
118 ms |
600 KB |
Output is correct |
21 |
Correct |
0 ms |
344 KB |
Output is correct |
22 |
Correct |
0 ms |
344 KB |
Output is correct |
23 |
Correct |
0 ms |
344 KB |
Output is correct |
24 |
Correct |
0 ms |
344 KB |
Output is correct |
25 |
Correct |
0 ms |
344 KB |
Output is correct |
26 |
Correct |
93 ms |
600 KB |
Output is correct |
27 |
Correct |
1 ms |
344 KB |
Output is correct |
28 |
Correct |
0 ms |
344 KB |
Output is correct |
29 |
Correct |
0 ms |
344 KB |
Output is correct |
30 |
Correct |
0 ms |
344 KB |
Output is correct |
31 |
Correct |
1 ms |
344 KB |
Output is correct |
32 |
Correct |
83 ms |
468 KB |
Output is correct |
33 |
Runtime error |
2 ms |
600 KB |
Execution killed with signal 11 |
34 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
2 ms |
852 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |