Submission #710393

# Submission time Handle Problem Language Result Execution time Memory
710393 2023-03-15T08:06:21 Z Darren0724 Minerals (JOI19_minerals) C++17
Compilation error
0 ms 0 KB
#include "minerals.h"
#include "grader.cpp"
#include<bits/stdc++.h>
using namespace std;
mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
void Solve(int N) {
    vector<int> v(N*2+1,-1);
    vector<bitset<30001>> rec(33);
    for(int t=0;t<33;t++){
        vector<int> idx(N*2);
        iota(idx.begin(),idx.end(),1);
        shuffle(idx.begin(),idx.end(),rnd);
        int a=0;
        for(int j=0;j<N*2;j++){
            int i=idx[j];
            int b=Query(i);
            if(b==a){
                Query(i);
            }
            else{
                a=b;
                rec[t][i]=1;
            }
        }
        for(int j=0;j<N*2;j++){
            int i=idx[j];
            if(rec[t][i]==1){
                Query(i);
            }
        }
    }
    for(int i=1;i<=N*2;i++){
        bitset<30001> tmp;
        for(int j=0;j<33;j++){
            if(rec[j][i]){
                tmp|=rec[j];
            }
        }
        for(int j=i+1;j<=N*2;j++){
            if(tmp[j]==0){
                Answer(i,j);
            }
        }
    }

}

Compilation message

/usr/bin/ld: /tmp/ccjKKY5R.o: in function `Query(int)':
grader.cpp:(.text+0x30): multiple definition of `Query(int)'; /tmp/ccXvESgT.o:minerals.cpp:(.text+0x30): first defined here
/usr/bin/ld: /tmp/ccjKKY5R.o: in function `Answer(int, int)':
grader.cpp:(.text+0x100): multiple definition of `Answer(int, int)'; /tmp/ccXvESgT.o:minerals.cpp:(.text+0x100): first defined here
/usr/bin/ld: /tmp/ccjKKY5R.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/ccXvESgT.o:minerals.cpp:(.text.startup+0x0): first defined here
collect2: error: ld returned 1 exit status