Submission #1077630

# Submission time Handle Problem Language Result Execution time Memory
1077630 2024-08-27T08:25:57 Z azberjibiou Minerals (JOI19_minerals) C++17
0 / 100
85 ms 125496 KB
#include "minerals.h"
#include <bits/stdc++.h>
using namespace std;

int solv(vector <int> v, int pval, bool ud){
    int sz=v.size();
    if(sz==2){
        Answer(v[0], v[1]);
        return pval;
    }
    int mid=sz/4;
    vector <int> nv1, nv2;
    for(int i=0;i<sz;i++){
        int now=Query(v[i]);
        if((ud && now>pval+mid) || (!ud && now<pval-mid)){
            nv1.push_back(v[i]);
            Query(v[i]);
        }
        else{
            nv2.push_back(v[i]);
        }
    }
    int nxtv=solv(nv1, pval+(ud ? mid : -mid), ud);
    return solv(nv2, nxtv, ud^1);
}
void Solve(int N) {
    vector <int> v;
    for(int i=1;i<=2*N;i++) v.push_back(i);
    solv(v, 0, 1);
}
# Verdict Execution time Memory Grader output
1 Incorrect 85 ms 125496 KB Wrong Answer [2]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 84 ms 124752 KB Wrong Answer [2]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 85 ms 125496 KB Wrong Answer [2]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 85 ms 125496 KB Wrong Answer [2]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 85 ms 125496 KB Wrong Answer [2]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 85 ms 125496 KB Wrong Answer [2]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 85 ms 125496 KB Wrong Answer [2]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 85 ms 125496 KB Wrong Answer [2]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 85 ms 125496 KB Wrong Answer [2]
2 Halted 0 ms 0 KB -