Submission #1077926

# Submission time Handle Problem Language Result Execution time Memory
1077926 2024-08-27T10:38:34 Z azberjibiou Minerals (JOI19_minerals) C++17
0 / 100
139 ms 262144 KB
#include "minerals.h"
#include <bits/stdc++.h>
using namespace std;
 
int ret;
void solv(vector <int> v1, vector <int> v2, int in1, int in2){
    int sz=v2.size();
    if(sz==1){
        Answer(v1[0], v2[0]);
        return;
    }
    vector <int> v11, v12, v21, v22;
    int mid=(sz/2);
    for(int i=0;i<mid;i++) ret=Query(v1[i]), v11.push_back(v1[i]);
    for(int i=mid;i<sz;i++) v12.push_back(v2[i]);
    for(int i=0;i<sz;i++){
        int nr=Query(v2[i]);
        if(nr==ret){
            if(in1==1) v22.push_back(v2[i]);
            else v21.push_back(v2[i]);
        }
        else{
            if(in1==1) v21.push_back(v2[i]);
            else v22.push_back(v2[i]);
        }
        ret=nr;
    }
    solv(v11, v21, 1-in1, 1-in2);
    solv(v12, v22, in1, 1-in2);
}
void Solve(int N) {
    if(N==1){
        Answer(1, 2);
        return;
    }
    ret=0;
    vector <int> v1, v2;
    for(int i=1;i<=2*N;i++){
        int nr=Query(i);
        if(nr==ret) v2.push_back(i);
        else v1.push_back(i);
        ret=nr;
    }
    solv(v1, v2, 1, 1);
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 KB Wrong Answer [4]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 139 ms 262144 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 KB Wrong Answer [4]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 KB Wrong Answer [4]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 KB Wrong Answer [4]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 KB Wrong Answer [4]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 KB Wrong Answer [4]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 KB Wrong Answer [4]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 KB Wrong Answer [4]
2 Halted 0 ms 0 KB -