답안 #250110

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
250110 2020-07-17T03:38:04 Z cheeheng Minerals (JOI19_minerals) C++14
40 / 100
37 ms 3224 KB
#include "minerals.h"
#include <bits/stdc++.h>
using namespace std;

void rec(vector<int> list1, vector<int> list2){
    int size1 = (int)list1.size();

    if(size1 == 1){
        Answer(list1[0], list2[0]);
        return;
    }

    int M = size1/2;

    vector<int> list3;
    for(int i = 0; i < M; i ++){
        list3.push_back(list1[i]);
        Query(list1[i]);
    }

    vector<int> list5;
    for(int i = M; i < size1; i ++){
        list5.push_back(list1[i]);
    }

    vector<int> list4;
    vector<int> list6;

    for(int i = 0; i < size1; i ++){
        int temp = Query(list2[i]);
        if(temp == M){
            list4.push_back(list2[i]);
        }else{
            list6.push_back(list2[i]);
        }

        Query(list2[i]);
    }

    for(int i = 0; i < M; i ++){
        Query(list1[i]);
    }

    rec(list3, list4);
    rec(list5, list6);
    return;
}

void Solve(int N) {
    int curUnique = 0;
    vector<int> list1;
    vector<int> list2;
    for(int i = 1; i <= 2*N; i ++){
        int temp = Query(i);
        if(temp > curUnique){
            list1.push_back(i);
        }else{
            list2.push_back(i);
        }

        curUnique = temp;
    }

    /*
    for(int i: list1){
        printf("%d\n", i);
    }
    */

    for(int i = 1; i <= 2*N; i ++){
        Query(i);
    }

    rec(list1, list2);
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 384 KB Output is correct
2 Correct 0 ms 384 KB Output is correct
3 Correct 0 ms 384 KB Output is correct
4 Correct 0 ms 384 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 384 KB Output is correct
2 Correct 3 ms 512 KB Output is correct
3 Correct 6 ms 640 KB Output is correct
4 Correct 12 ms 896 KB Output is correct
5 Correct 21 ms 1356 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 384 KB Output is correct
2 Correct 0 ms 384 KB Output is correct
3 Correct 0 ms 384 KB Output is correct
4 Correct 0 ms 384 KB Output is correct
5 Correct 1 ms 384 KB Output is correct
6 Correct 3 ms 512 KB Output is correct
7 Correct 6 ms 640 KB Output is correct
8 Correct 12 ms 896 KB Output is correct
9 Correct 21 ms 1356 KB Output is correct
10 Correct 1 ms 384 KB Output is correct
11 Correct 15 ms 1152 KB Output is correct
12 Correct 22 ms 1444 KB Output is correct
13 Correct 20 ms 1460 KB Output is correct
14 Correct 19 ms 1324 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 384 KB Output is correct
2 Correct 0 ms 384 KB Output is correct
3 Correct 0 ms 384 KB Output is correct
4 Correct 0 ms 384 KB Output is correct
5 Correct 1 ms 384 KB Output is correct
6 Correct 3 ms 512 KB Output is correct
7 Correct 6 ms 640 KB Output is correct
8 Correct 12 ms 896 KB Output is correct
9 Correct 21 ms 1356 KB Output is correct
10 Correct 1 ms 384 KB Output is correct
11 Correct 15 ms 1152 KB Output is correct
12 Correct 22 ms 1444 KB Output is correct
13 Correct 20 ms 1460 KB Output is correct
14 Correct 19 ms 1324 KB Output is correct
15 Incorrect 37 ms 3224 KB Wrong Answer [2]
16 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 384 KB Output is correct
2 Correct 0 ms 384 KB Output is correct
3 Correct 0 ms 384 KB Output is correct
4 Correct 0 ms 384 KB Output is correct
5 Correct 1 ms 384 KB Output is correct
6 Correct 3 ms 512 KB Output is correct
7 Correct 6 ms 640 KB Output is correct
8 Correct 12 ms 896 KB Output is correct
9 Correct 21 ms 1356 KB Output is correct
10 Correct 1 ms 384 KB Output is correct
11 Correct 15 ms 1152 KB Output is correct
12 Correct 22 ms 1444 KB Output is correct
13 Correct 20 ms 1460 KB Output is correct
14 Correct 19 ms 1324 KB Output is correct
15 Incorrect 37 ms 3224 KB Wrong Answer [2]
16 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 384 KB Output is correct
2 Correct 0 ms 384 KB Output is correct
3 Correct 0 ms 384 KB Output is correct
4 Correct 0 ms 384 KB Output is correct
5 Correct 1 ms 384 KB Output is correct
6 Correct 3 ms 512 KB Output is correct
7 Correct 6 ms 640 KB Output is correct
8 Correct 12 ms 896 KB Output is correct
9 Correct 21 ms 1356 KB Output is correct
10 Correct 1 ms 384 KB Output is correct
11 Correct 15 ms 1152 KB Output is correct
12 Correct 22 ms 1444 KB Output is correct
13 Correct 20 ms 1460 KB Output is correct
14 Correct 19 ms 1324 KB Output is correct
15 Incorrect 37 ms 3224 KB Wrong Answer [2]
16 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 384 KB Output is correct
2 Correct 0 ms 384 KB Output is correct
3 Correct 0 ms 384 KB Output is correct
4 Correct 0 ms 384 KB Output is correct
5 Correct 1 ms 384 KB Output is correct
6 Correct 3 ms 512 KB Output is correct
7 Correct 6 ms 640 KB Output is correct
8 Correct 12 ms 896 KB Output is correct
9 Correct 21 ms 1356 KB Output is correct
10 Correct 1 ms 384 KB Output is correct
11 Correct 15 ms 1152 KB Output is correct
12 Correct 22 ms 1444 KB Output is correct
13 Correct 20 ms 1460 KB Output is correct
14 Correct 19 ms 1324 KB Output is correct
15 Incorrect 37 ms 3224 KB Wrong Answer [2]
16 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 384 KB Output is correct
2 Correct 0 ms 384 KB Output is correct
3 Correct 0 ms 384 KB Output is correct
4 Correct 0 ms 384 KB Output is correct
5 Correct 1 ms 384 KB Output is correct
6 Correct 3 ms 512 KB Output is correct
7 Correct 6 ms 640 KB Output is correct
8 Correct 12 ms 896 KB Output is correct
9 Correct 21 ms 1356 KB Output is correct
10 Correct 1 ms 384 KB Output is correct
11 Correct 15 ms 1152 KB Output is correct
12 Correct 22 ms 1444 KB Output is correct
13 Correct 20 ms 1460 KB Output is correct
14 Correct 19 ms 1324 KB Output is correct
15 Incorrect 37 ms 3224 KB Wrong Answer [2]
16 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 384 KB Output is correct
2 Correct 0 ms 384 KB Output is correct
3 Correct 0 ms 384 KB Output is correct
4 Correct 0 ms 384 KB Output is correct
5 Correct 1 ms 384 KB Output is correct
6 Correct 3 ms 512 KB Output is correct
7 Correct 6 ms 640 KB Output is correct
8 Correct 12 ms 896 KB Output is correct
9 Correct 21 ms 1356 KB Output is correct
10 Correct 1 ms 384 KB Output is correct
11 Correct 15 ms 1152 KB Output is correct
12 Correct 22 ms 1444 KB Output is correct
13 Correct 20 ms 1460 KB Output is correct
14 Correct 19 ms 1324 KB Output is correct
15 Incorrect 37 ms 3224 KB Wrong Answer [2]
16 Halted 0 ms 0 KB -