Submission #815746

# Submission time Handle Problem Language Result Execution time Memory
815746 2023-08-08T20:35:43 Z JakobZorz Minerals (JOI19_minerals) C++14
40 / 100
124 ms 262144 KB
#include"minerals.h"
#include<iostream>
#include<vector>
using namespace std;

int flag[50000];
int query(int a){
    flag[a]++;
    flag[a]%=2;
    return Query(a);
}

void solve(vector<int>m){
    //cout<<m.size()<<"\n";
    if(m.size()==2){
        Answer(m[0],m[1]);
        return;
    }
    
    int n=(int)m.size()/2;
    for(int i:m)
        if(query(i)>n/2)
            query(i);
    
    vector<int>m1,m2;
    
    for(int i:m){
        if(flag[i]){
            query(i);
            m1.push_back(i);
        }else
            m2.push_back(i);
    }
    
    solve(m1);
    solve(m2);
}

void Solve(int N){
    vector<int>m;
    for(int i=1;i<=2*N;i++)
        m.push_back(i);
    solve(m);
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 208 KB Output is correct
2 Correct 0 ms 208 KB Output is correct
3 Correct 0 ms 208 KB Output is correct
4 Correct 0 ms 208 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 336 KB Output is correct
2 Correct 2 ms 464 KB Output is correct
3 Correct 3 ms 592 KB Output is correct
4 Correct 7 ms 848 KB Output is correct
5 Correct 15 ms 1424 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 208 KB Output is correct
2 Correct 0 ms 208 KB Output is correct
3 Correct 0 ms 208 KB Output is correct
4 Correct 0 ms 208 KB Output is correct
5 Correct 1 ms 336 KB Output is correct
6 Correct 2 ms 464 KB Output is correct
7 Correct 3 ms 592 KB Output is correct
8 Correct 7 ms 848 KB Output is correct
9 Correct 15 ms 1424 KB Output is correct
10 Correct 1 ms 396 KB Output is correct
11 Correct 9 ms 1104 KB Output is correct
12 Correct 14 ms 1488 KB Output is correct
13 Correct 9 ms 1492 KB Output is correct
14 Correct 9 ms 1360 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 208 KB Output is correct
2 Correct 0 ms 208 KB Output is correct
3 Correct 0 ms 208 KB Output is correct
4 Correct 0 ms 208 KB Output is correct
5 Correct 1 ms 336 KB Output is correct
6 Correct 2 ms 464 KB Output is correct
7 Correct 3 ms 592 KB Output is correct
8 Correct 7 ms 848 KB Output is correct
9 Correct 15 ms 1424 KB Output is correct
10 Correct 1 ms 396 KB Output is correct
11 Correct 9 ms 1104 KB Output is correct
12 Correct 14 ms 1488 KB Output is correct
13 Correct 9 ms 1492 KB Output is correct
14 Correct 9 ms 1360 KB Output is correct
15 Runtime error 124 ms 262144 KB Execution killed with signal 9
16 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 208 KB Output is correct
2 Correct 0 ms 208 KB Output is correct
3 Correct 0 ms 208 KB Output is correct
4 Correct 0 ms 208 KB Output is correct
5 Correct 1 ms 336 KB Output is correct
6 Correct 2 ms 464 KB Output is correct
7 Correct 3 ms 592 KB Output is correct
8 Correct 7 ms 848 KB Output is correct
9 Correct 15 ms 1424 KB Output is correct
10 Correct 1 ms 396 KB Output is correct
11 Correct 9 ms 1104 KB Output is correct
12 Correct 14 ms 1488 KB Output is correct
13 Correct 9 ms 1492 KB Output is correct
14 Correct 9 ms 1360 KB Output is correct
15 Runtime error 124 ms 262144 KB Execution killed with signal 9
16 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 208 KB Output is correct
2 Correct 0 ms 208 KB Output is correct
3 Correct 0 ms 208 KB Output is correct
4 Correct 0 ms 208 KB Output is correct
5 Correct 1 ms 336 KB Output is correct
6 Correct 2 ms 464 KB Output is correct
7 Correct 3 ms 592 KB Output is correct
8 Correct 7 ms 848 KB Output is correct
9 Correct 15 ms 1424 KB Output is correct
10 Correct 1 ms 396 KB Output is correct
11 Correct 9 ms 1104 KB Output is correct
12 Correct 14 ms 1488 KB Output is correct
13 Correct 9 ms 1492 KB Output is correct
14 Correct 9 ms 1360 KB Output is correct
15 Runtime error 124 ms 262144 KB Execution killed with signal 9
16 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 208 KB Output is correct
2 Correct 0 ms 208 KB Output is correct
3 Correct 0 ms 208 KB Output is correct
4 Correct 0 ms 208 KB Output is correct
5 Correct 1 ms 336 KB Output is correct
6 Correct 2 ms 464 KB Output is correct
7 Correct 3 ms 592 KB Output is correct
8 Correct 7 ms 848 KB Output is correct
9 Correct 15 ms 1424 KB Output is correct
10 Correct 1 ms 396 KB Output is correct
11 Correct 9 ms 1104 KB Output is correct
12 Correct 14 ms 1488 KB Output is correct
13 Correct 9 ms 1492 KB Output is correct
14 Correct 9 ms 1360 KB Output is correct
15 Runtime error 124 ms 262144 KB Execution killed with signal 9
16 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 208 KB Output is correct
2 Correct 0 ms 208 KB Output is correct
3 Correct 0 ms 208 KB Output is correct
4 Correct 0 ms 208 KB Output is correct
5 Correct 1 ms 336 KB Output is correct
6 Correct 2 ms 464 KB Output is correct
7 Correct 3 ms 592 KB Output is correct
8 Correct 7 ms 848 KB Output is correct
9 Correct 15 ms 1424 KB Output is correct
10 Correct 1 ms 396 KB Output is correct
11 Correct 9 ms 1104 KB Output is correct
12 Correct 14 ms 1488 KB Output is correct
13 Correct 9 ms 1492 KB Output is correct
14 Correct 9 ms 1360 KB Output is correct
15 Runtime error 124 ms 262144 KB Execution killed with signal 9
16 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 208 KB Output is correct
2 Correct 0 ms 208 KB Output is correct
3 Correct 0 ms 208 KB Output is correct
4 Correct 0 ms 208 KB Output is correct
5 Correct 1 ms 336 KB Output is correct
6 Correct 2 ms 464 KB Output is correct
7 Correct 3 ms 592 KB Output is correct
8 Correct 7 ms 848 KB Output is correct
9 Correct 15 ms 1424 KB Output is correct
10 Correct 1 ms 396 KB Output is correct
11 Correct 9 ms 1104 KB Output is correct
12 Correct 14 ms 1488 KB Output is correct
13 Correct 9 ms 1492 KB Output is correct
14 Correct 9 ms 1360 KB Output is correct
15 Runtime error 124 ms 262144 KB Execution killed with signal 9
16 Halted 0 ms 0 KB -