Submission #128255

# Submission time Handle Problem Language Result Execution time Memory
128255 2019-07-10T15:22:13 Z Osama_Alkhodairy Minerals (JOI19_minerals) C++17
25 / 100
18 ms 824 KB
#include <bits/stdc++.h>
#include "minerals.h"
//~ #include "grader.cpp"
using namespace std;

int curl, curr;

void solve(int l, int r, vector <int> &cur){
    if(r < l) return;
    if(l == r){
        assert(cur.size() == 1);
        Answer(l, cur[0]);
        return;
    }
    int mid = (l + r) / 2;
    while(curl > l){
        l--;
        Query(curl);
    }
    while(curr < r){
        curr++;
        Query(curr);
    }
    while(curl < l){
        Query(curl);
        curl++;
    }
    while(curr > mid){
        Query(curr);
        curr--;
    }
    vector <int> left, right;
    for(auto &i : cur){
        int x = Query(i);
        if(x == mid - l + 1) left.push_back(i);
        else right.push_back(i);
        Query(i);
    }
    solve(l, mid, left);
    solve(mid + 1, r, right);
}
void Solve(int N){
    curl = N + 1;
    curr = 2 * N;
    vector <int> all;
    for(int i = 1 ; i <= 2 * N ; i++){
        if(i <= N) all.push_back(i);
        else Query(i);
    }
    solve(N + 1, 2 * N, all);
}
# Verdict Execution time Memory Grader output
1 Runtime error 3 ms 504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 3 ms 248 KB Output is correct
2 Correct 4 ms 376 KB Output is correct
3 Correct 6 ms 504 KB Output is correct
4 Correct 10 ms 632 KB Output is correct
5 Correct 18 ms 824 KB Output is correct
# Verdict Execution time Memory Grader output
1 Runtime error 3 ms 504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 3 ms 504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 3 ms 504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 3 ms 504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 3 ms 504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 3 ms 504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 3 ms 504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -