Submission #376767

# Submission time Handle Problem Language Result Execution time Memory
376767 2021-03-12T03:32:04 Z daniel920712 Minerals (JOI19_minerals) C++14
0 / 100
1 ms 364 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||!(j&(1<<(i-1))))) 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)))) x=Query(cha[j]);
    }
    for(i=1;i<=N;i++)
    {
        Answer(cha[i+N],cha[ans[i]]);
    }
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 364 KB Wrong Answer [3]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 364 KB Wrong Answer [3]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 364 KB Wrong Answer [3]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 364 KB Wrong Answer [3]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 364 KB Wrong Answer [3]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 364 KB Wrong Answer [3]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 364 KB Wrong Answer [3]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 364 KB Wrong Answer [3]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 364 KB Wrong Answer [3]
2 Halted 0 ms 0 KB -