#include "minerals.h"
#include <vector>
#include <stdio.h>
//using namespace std;
int ans[86005]={0};
bool have[86005];
int cha[86005];
void Solve(int N)
{
int x=0,y,i,j,now=1;
for(i=1;i<=2*N;i++)
{
y=Query(i);
if(y-x==0)
{
cha[now++]=i;
have[i]=1;
}
x=y;
}
for(i=1;i<=2*N;i++)
{
Query(i);
if(have[i]==0) cha[now++]=i;
}
for(i=0;i<14;i++)
{
for(j=1;j<=N;j++) if(j&(1<<i)) x=Query(cha[j]);
for(j=1;j<=N;j++)
{
y=Query(cha[j+N]);
if(y-x==0) ans[j]+=(1<<i);
x=y;
}
for(j=1;j<=N;j++) if(j&(1<<i)) x=Query(cha[j]);
for(j=1;j<=N;j++) x=Query(cha[j+N]);
}
for(i=1;i<=N;i++)
{
//printf("%d %d\n",i+N,ans[i]);
Answer(cha[i+N],cha[ans[i]]);
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
364 KB |
Output is correct |
2 |
Correct |
0 ms |
364 KB |
Output is correct |
3 |
Correct |
1 ms |
364 KB |
Output is correct |
4 |
Correct |
0 ms |
364 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
364 KB |
Output is correct |
2 |
Correct |
2 ms |
364 KB |
Output is correct |
3 |
Correct |
3 ms |
492 KB |
Output is correct |
4 |
Correct |
6 ms |
620 KB |
Output is correct |
5 |
Correct |
11 ms |
876 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
364 KB |
Output is correct |
2 |
Correct |
0 ms |
364 KB |
Output is correct |
3 |
Correct |
1 ms |
364 KB |
Output is correct |
4 |
Correct |
0 ms |
364 KB |
Output is correct |
5 |
Correct |
1 ms |
364 KB |
Output is correct |
6 |
Correct |
2 ms |
364 KB |
Output is correct |
7 |
Correct |
3 ms |
492 KB |
Output is correct |
8 |
Correct |
6 ms |
620 KB |
Output is correct |
9 |
Correct |
11 ms |
876 KB |
Output is correct |
10 |
Correct |
1 ms |
364 KB |
Output is correct |
11 |
Correct |
8 ms |
748 KB |
Output is correct |
12 |
Correct |
12 ms |
1004 KB |
Output is correct |
13 |
Correct |
11 ms |
928 KB |
Output is correct |
14 |
Correct |
10 ms |
876 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
364 KB |
Output is correct |
2 |
Correct |
0 ms |
364 KB |
Output is correct |
3 |
Correct |
1 ms |
364 KB |
Output is correct |
4 |
Correct |
0 ms |
364 KB |
Output is correct |
5 |
Correct |
1 ms |
364 KB |
Output is correct |
6 |
Correct |
2 ms |
364 KB |
Output is correct |
7 |
Correct |
3 ms |
492 KB |
Output is correct |
8 |
Correct |
6 ms |
620 KB |
Output is correct |
9 |
Correct |
11 ms |
876 KB |
Output is correct |
10 |
Correct |
1 ms |
364 KB |
Output is correct |
11 |
Correct |
8 ms |
748 KB |
Output is correct |
12 |
Correct |
12 ms |
1004 KB |
Output is correct |
13 |
Correct |
11 ms |
928 KB |
Output is correct |
14 |
Correct |
10 ms |
876 KB |
Output is correct |
15 |
Incorrect |
24 ms |
1772 KB |
Wrong Answer [2] |
16 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
364 KB |
Output is correct |
2 |
Correct |
0 ms |
364 KB |
Output is correct |
3 |
Correct |
1 ms |
364 KB |
Output is correct |
4 |
Correct |
0 ms |
364 KB |
Output is correct |
5 |
Correct |
1 ms |
364 KB |
Output is correct |
6 |
Correct |
2 ms |
364 KB |
Output is correct |
7 |
Correct |
3 ms |
492 KB |
Output is correct |
8 |
Correct |
6 ms |
620 KB |
Output is correct |
9 |
Correct |
11 ms |
876 KB |
Output is correct |
10 |
Correct |
1 ms |
364 KB |
Output is correct |
11 |
Correct |
8 ms |
748 KB |
Output is correct |
12 |
Correct |
12 ms |
1004 KB |
Output is correct |
13 |
Correct |
11 ms |
928 KB |
Output is correct |
14 |
Correct |
10 ms |
876 KB |
Output is correct |
15 |
Incorrect |
24 ms |
1772 KB |
Wrong Answer [2] |
16 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
364 KB |
Output is correct |
2 |
Correct |
0 ms |
364 KB |
Output is correct |
3 |
Correct |
1 ms |
364 KB |
Output is correct |
4 |
Correct |
0 ms |
364 KB |
Output is correct |
5 |
Correct |
1 ms |
364 KB |
Output is correct |
6 |
Correct |
2 ms |
364 KB |
Output is correct |
7 |
Correct |
3 ms |
492 KB |
Output is correct |
8 |
Correct |
6 ms |
620 KB |
Output is correct |
9 |
Correct |
11 ms |
876 KB |
Output is correct |
10 |
Correct |
1 ms |
364 KB |
Output is correct |
11 |
Correct |
8 ms |
748 KB |
Output is correct |
12 |
Correct |
12 ms |
1004 KB |
Output is correct |
13 |
Correct |
11 ms |
928 KB |
Output is correct |
14 |
Correct |
10 ms |
876 KB |
Output is correct |
15 |
Incorrect |
24 ms |
1772 KB |
Wrong Answer [2] |
16 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
364 KB |
Output is correct |
2 |
Correct |
0 ms |
364 KB |
Output is correct |
3 |
Correct |
1 ms |
364 KB |
Output is correct |
4 |
Correct |
0 ms |
364 KB |
Output is correct |
5 |
Correct |
1 ms |
364 KB |
Output is correct |
6 |
Correct |
2 ms |
364 KB |
Output is correct |
7 |
Correct |
3 ms |
492 KB |
Output is correct |
8 |
Correct |
6 ms |
620 KB |
Output is correct |
9 |
Correct |
11 ms |
876 KB |
Output is correct |
10 |
Correct |
1 ms |
364 KB |
Output is correct |
11 |
Correct |
8 ms |
748 KB |
Output is correct |
12 |
Correct |
12 ms |
1004 KB |
Output is correct |
13 |
Correct |
11 ms |
928 KB |
Output is correct |
14 |
Correct |
10 ms |
876 KB |
Output is correct |
15 |
Incorrect |
24 ms |
1772 KB |
Wrong Answer [2] |
16 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
364 KB |
Output is correct |
2 |
Correct |
0 ms |
364 KB |
Output is correct |
3 |
Correct |
1 ms |
364 KB |
Output is correct |
4 |
Correct |
0 ms |
364 KB |
Output is correct |
5 |
Correct |
1 ms |
364 KB |
Output is correct |
6 |
Correct |
2 ms |
364 KB |
Output is correct |
7 |
Correct |
3 ms |
492 KB |
Output is correct |
8 |
Correct |
6 ms |
620 KB |
Output is correct |
9 |
Correct |
11 ms |
876 KB |
Output is correct |
10 |
Correct |
1 ms |
364 KB |
Output is correct |
11 |
Correct |
8 ms |
748 KB |
Output is correct |
12 |
Correct |
12 ms |
1004 KB |
Output is correct |
13 |
Correct |
11 ms |
928 KB |
Output is correct |
14 |
Correct |
10 ms |
876 KB |
Output is correct |
15 |
Incorrect |
24 ms |
1772 KB |
Wrong Answer [2] |
16 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
364 KB |
Output is correct |
2 |
Correct |
0 ms |
364 KB |
Output is correct |
3 |
Correct |
1 ms |
364 KB |
Output is correct |
4 |
Correct |
0 ms |
364 KB |
Output is correct |
5 |
Correct |
1 ms |
364 KB |
Output is correct |
6 |
Correct |
2 ms |
364 KB |
Output is correct |
7 |
Correct |
3 ms |
492 KB |
Output is correct |
8 |
Correct |
6 ms |
620 KB |
Output is correct |
9 |
Correct |
11 ms |
876 KB |
Output is correct |
10 |
Correct |
1 ms |
364 KB |
Output is correct |
11 |
Correct |
8 ms |
748 KB |
Output is correct |
12 |
Correct |
12 ms |
1004 KB |
Output is correct |
13 |
Correct |
11 ms |
928 KB |
Output is correct |
14 |
Correct |
10 ms |
876 KB |
Output is correct |
15 |
Incorrect |
24 ms |
1772 KB |
Wrong Answer [2] |
16 |
Halted |
0 ms |
0 KB |
- |