답안 #376757

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
376757 2021-03-12T03:26:47 Z daniel920712 Minerals (JOI19_minerals) C++14
40 / 100
20 ms 1772 KB
#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<16;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 512 KB Output is correct
2 Correct 1 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 4 ms 492 KB Output is correct
4 Correct 7 ms 748 KB Output is correct
5 Correct 12 ms 876 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 512 KB Output is correct
2 Correct 1 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 4 ms 492 KB Output is correct
8 Correct 7 ms 748 KB Output is correct
9 Correct 12 ms 876 KB Output is correct
10 Correct 2 ms 364 KB Output is correct
11 Correct 8 ms 748 KB Output is correct
12 Correct 14 ms 1004 KB Output is correct
13 Correct 10 ms 1004 KB Output is correct
14 Correct 10 ms 876 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 512 KB Output is correct
2 Correct 1 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 4 ms 492 KB Output is correct
8 Correct 7 ms 748 KB Output is correct
9 Correct 12 ms 876 KB Output is correct
10 Correct 2 ms 364 KB Output is correct
11 Correct 8 ms 748 KB Output is correct
12 Correct 14 ms 1004 KB Output is correct
13 Correct 10 ms 1004 KB Output is correct
14 Correct 10 ms 876 KB Output is correct
15 Incorrect 20 ms 1772 KB Wrong Answer [2]
16 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 512 KB Output is correct
2 Correct 1 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 4 ms 492 KB Output is correct
8 Correct 7 ms 748 KB Output is correct
9 Correct 12 ms 876 KB Output is correct
10 Correct 2 ms 364 KB Output is correct
11 Correct 8 ms 748 KB Output is correct
12 Correct 14 ms 1004 KB Output is correct
13 Correct 10 ms 1004 KB Output is correct
14 Correct 10 ms 876 KB Output is correct
15 Incorrect 20 ms 1772 KB Wrong Answer [2]
16 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 512 KB Output is correct
2 Correct 1 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 4 ms 492 KB Output is correct
8 Correct 7 ms 748 KB Output is correct
9 Correct 12 ms 876 KB Output is correct
10 Correct 2 ms 364 KB Output is correct
11 Correct 8 ms 748 KB Output is correct
12 Correct 14 ms 1004 KB Output is correct
13 Correct 10 ms 1004 KB Output is correct
14 Correct 10 ms 876 KB Output is correct
15 Incorrect 20 ms 1772 KB Wrong Answer [2]
16 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 512 KB Output is correct
2 Correct 1 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 4 ms 492 KB Output is correct
8 Correct 7 ms 748 KB Output is correct
9 Correct 12 ms 876 KB Output is correct
10 Correct 2 ms 364 KB Output is correct
11 Correct 8 ms 748 KB Output is correct
12 Correct 14 ms 1004 KB Output is correct
13 Correct 10 ms 1004 KB Output is correct
14 Correct 10 ms 876 KB Output is correct
15 Incorrect 20 ms 1772 KB Wrong Answer [2]
16 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 512 KB Output is correct
2 Correct 1 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 4 ms 492 KB Output is correct
8 Correct 7 ms 748 KB Output is correct
9 Correct 12 ms 876 KB Output is correct
10 Correct 2 ms 364 KB Output is correct
11 Correct 8 ms 748 KB Output is correct
12 Correct 14 ms 1004 KB Output is correct
13 Correct 10 ms 1004 KB Output is correct
14 Correct 10 ms 876 KB Output is correct
15 Incorrect 20 ms 1772 KB Wrong Answer [2]
16 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 512 KB Output is correct
2 Correct 1 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 4 ms 492 KB Output is correct
8 Correct 7 ms 748 KB Output is correct
9 Correct 12 ms 876 KB Output is correct
10 Correct 2 ms 364 KB Output is correct
11 Correct 8 ms 748 KB Output is correct
12 Correct 14 ms 1004 KB Output is correct
13 Correct 10 ms 1004 KB Output is correct
14 Correct 10 ms 876 KB Output is correct
15 Incorrect 20 ms 1772 KB Wrong Answer [2]
16 Halted 0 ms 0 KB -