답안 #376785

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
376785 2021-03-12T03:54:43 Z daniel920712 Minerals (JOI19_minerals) C++14
40 / 100
23 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<15;i++)
    {
        for(j=1;j<=N;j++) if((j&(1<<i))&&(i==0||(j&(1<<(i-1)))==0)) 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))&&(j&(1<<(i+1)))==0&&i!=14) x=Query(cha[j]);
    }
    for(i=1;i<=N;i++)
    {
        Answer(cha[i+N],cha[ans[i]]);
    }
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 364 KB Output is correct
2 Correct 1 ms 364 KB Output is correct
3 Correct 0 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 9 ms 876 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 364 KB Output is correct
2 Correct 1 ms 364 KB Output is correct
3 Correct 0 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 9 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 10 ms 1004 KB Output is correct
13 Correct 8 ms 1004 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 1 ms 364 KB Output is correct
3 Correct 0 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 9 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 10 ms 1004 KB Output is correct
13 Correct 8 ms 1004 KB Output is correct
14 Correct 10 ms 876 KB Output is correct
15 Incorrect 23 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 1 ms 364 KB Output is correct
3 Correct 0 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 9 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 10 ms 1004 KB Output is correct
13 Correct 8 ms 1004 KB Output is correct
14 Correct 10 ms 876 KB Output is correct
15 Incorrect 23 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 1 ms 364 KB Output is correct
3 Correct 0 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 9 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 10 ms 1004 KB Output is correct
13 Correct 8 ms 1004 KB Output is correct
14 Correct 10 ms 876 KB Output is correct
15 Incorrect 23 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 1 ms 364 KB Output is correct
3 Correct 0 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 9 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 10 ms 1004 KB Output is correct
13 Correct 8 ms 1004 KB Output is correct
14 Correct 10 ms 876 KB Output is correct
15 Incorrect 23 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 1 ms 364 KB Output is correct
3 Correct 0 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 9 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 10 ms 1004 KB Output is correct
13 Correct 8 ms 1004 KB Output is correct
14 Correct 10 ms 876 KB Output is correct
15 Incorrect 23 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 1 ms 364 KB Output is correct
3 Correct 0 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 9 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 10 ms 1004 KB Output is correct
13 Correct 8 ms 1004 KB Output is correct
14 Correct 10 ms 876 KB Output is correct
15 Incorrect 23 ms 1772 KB Wrong Answer [2]
16 Halted 0 ms 0 KB -