답안 #376772

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
376772 2021-03-12T03:35:23 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<16;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!=15) x=Query(cha[j]);
    }
    for(i=1;i<=N;i++)
    {
        Answer(cha[i+N],cha[ans[i]]);
    }
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 364 KB Output is correct
2 Correct 0 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 5 ms 620 KB Output is correct
5 Correct 11 ms 876 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 364 KB Output is correct
2 Correct 0 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 5 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 7 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 8 ms 876 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 364 KB Output is correct
2 Correct 0 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 5 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 7 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 8 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 0 ms 364 KB Output is correct
2 Correct 0 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 5 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 7 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 8 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 0 ms 364 KB Output is correct
2 Correct 0 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 5 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 7 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 8 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 0 ms 364 KB Output is correct
2 Correct 0 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 5 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 7 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 8 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 0 ms 364 KB Output is correct
2 Correct 0 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 5 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 7 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 8 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 0 ms 364 KB Output is correct
2 Correct 0 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 5 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 7 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 8 ms 876 KB Output is correct
15 Incorrect 23 ms 1772 KB Wrong Answer [2]
16 Halted 0 ms 0 KB -