답안 #377606

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
377606 2021-03-14T11:28:53 Z jass921026 Minerals (JOI19_minerals) C++14
40 / 100
32 ms 2740 KB
#include "minerals.h"
#include<bits/stdc++.h>
using namespace std;
vector<int> vl, vr;
void find_out(vector<int> &x, vector<int> &y){
    if(x.size()==1){
        Answer(x[0],y[0]);
        return;
    }
    vector<int> x1, x2, y1, y2;
    int v=0;
    for(int i=0;i<x.size();i++){
        if(i<x.size()/2) x1.push_back(x[i]);
        else x2.push_back(x[i]);
    }
    for(int i=0;i<x.size()/2;i++){
        v=Query(x[i]);
    }
    for(int i=0;i<y.size();i++){
        int tmp=Query(y[i]);
        if(tmp==v) y1.push_back(y[i]);
        else y2.push_back(y[i]);
        tmp=Query(y[i]);
    }
    for(int i=0;i<x.size()/2;i++){
        v=Query(x[i]);
    }
    find_out(x1,y1);
    find_out(x2,y2);
}
void Solve(int N) {
    int v=0;
    for(int i=1;i<=2*N;i++){
        int tmp=Query(i);
        if(tmp==v+1){
            v++;
            vl.push_back(i);
        } else{
            vr.push_back(i);
        }
    }
    for(int i=1;i<=2*N;i++) v=Query(i);
    find_out(vl,vr);
}

Compilation message

minerals.cpp: In function 'void find_out(std::vector<int>&, std::vector<int>&)':
minerals.cpp:12:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   12 |     for(int i=0;i<x.size();i++){
      |                 ~^~~~~~~~~
minerals.cpp:13:13: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   13 |         if(i<x.size()/2) x1.push_back(x[i]);
      |            ~^~~~~~~~~~~
minerals.cpp:16:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   16 |     for(int i=0;i<x.size()/2;i++){
      |                 ~^~~~~~~~~~~
minerals.cpp:19:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   19 |     for(int i=0;i<y.size();i++){
      |                 ~^~~~~~~~~
minerals.cpp:25:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   25 |     for(int i=0;i<x.size()/2;i++){
      |                 ~^~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 364 KB Output is correct
2 Correct 1 ms 364 KB Output is correct
3 Correct 1 ms 364 KB Output is correct
4 Correct 1 ms 364 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 364 KB Output is correct
2 Correct 2 ms 492 KB Output is correct
3 Correct 5 ms 492 KB Output is correct
4 Correct 9 ms 748 KB Output is correct
5 Correct 20 ms 1132 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 364 KB Output is correct
2 Correct 1 ms 364 KB Output is correct
3 Correct 1 ms 364 KB Output is correct
4 Correct 1 ms 364 KB Output is correct
5 Correct 1 ms 364 KB Output is correct
6 Correct 2 ms 492 KB Output is correct
7 Correct 5 ms 492 KB Output is correct
8 Correct 9 ms 748 KB Output is correct
9 Correct 20 ms 1132 KB Output is correct
10 Correct 1 ms 364 KB Output is correct
11 Correct 12 ms 1004 KB Output is correct
12 Correct 23 ms 1260 KB Output is correct
13 Correct 15 ms 1132 KB Output is correct
14 Correct 15 ms 1132 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 364 KB Output is correct
2 Correct 1 ms 364 KB Output is correct
3 Correct 1 ms 364 KB Output is correct
4 Correct 1 ms 364 KB Output is correct
5 Correct 1 ms 364 KB Output is correct
6 Correct 2 ms 492 KB Output is correct
7 Correct 5 ms 492 KB Output is correct
8 Correct 9 ms 748 KB Output is correct
9 Correct 20 ms 1132 KB Output is correct
10 Correct 1 ms 364 KB Output is correct
11 Correct 12 ms 1004 KB Output is correct
12 Correct 23 ms 1260 KB Output is correct
13 Correct 15 ms 1132 KB Output is correct
14 Correct 15 ms 1132 KB Output is correct
15 Incorrect 32 ms 2740 KB Wrong Answer [2]
16 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 364 KB Output is correct
2 Correct 1 ms 364 KB Output is correct
3 Correct 1 ms 364 KB Output is correct
4 Correct 1 ms 364 KB Output is correct
5 Correct 1 ms 364 KB Output is correct
6 Correct 2 ms 492 KB Output is correct
7 Correct 5 ms 492 KB Output is correct
8 Correct 9 ms 748 KB Output is correct
9 Correct 20 ms 1132 KB Output is correct
10 Correct 1 ms 364 KB Output is correct
11 Correct 12 ms 1004 KB Output is correct
12 Correct 23 ms 1260 KB Output is correct
13 Correct 15 ms 1132 KB Output is correct
14 Correct 15 ms 1132 KB Output is correct
15 Incorrect 32 ms 2740 KB Wrong Answer [2]
16 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 364 KB Output is correct
2 Correct 1 ms 364 KB Output is correct
3 Correct 1 ms 364 KB Output is correct
4 Correct 1 ms 364 KB Output is correct
5 Correct 1 ms 364 KB Output is correct
6 Correct 2 ms 492 KB Output is correct
7 Correct 5 ms 492 KB Output is correct
8 Correct 9 ms 748 KB Output is correct
9 Correct 20 ms 1132 KB Output is correct
10 Correct 1 ms 364 KB Output is correct
11 Correct 12 ms 1004 KB Output is correct
12 Correct 23 ms 1260 KB Output is correct
13 Correct 15 ms 1132 KB Output is correct
14 Correct 15 ms 1132 KB Output is correct
15 Incorrect 32 ms 2740 KB Wrong Answer [2]
16 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 364 KB Output is correct
2 Correct 1 ms 364 KB Output is correct
3 Correct 1 ms 364 KB Output is correct
4 Correct 1 ms 364 KB Output is correct
5 Correct 1 ms 364 KB Output is correct
6 Correct 2 ms 492 KB Output is correct
7 Correct 5 ms 492 KB Output is correct
8 Correct 9 ms 748 KB Output is correct
9 Correct 20 ms 1132 KB Output is correct
10 Correct 1 ms 364 KB Output is correct
11 Correct 12 ms 1004 KB Output is correct
12 Correct 23 ms 1260 KB Output is correct
13 Correct 15 ms 1132 KB Output is correct
14 Correct 15 ms 1132 KB Output is correct
15 Incorrect 32 ms 2740 KB Wrong Answer [2]
16 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 364 KB Output is correct
2 Correct 1 ms 364 KB Output is correct
3 Correct 1 ms 364 KB Output is correct
4 Correct 1 ms 364 KB Output is correct
5 Correct 1 ms 364 KB Output is correct
6 Correct 2 ms 492 KB Output is correct
7 Correct 5 ms 492 KB Output is correct
8 Correct 9 ms 748 KB Output is correct
9 Correct 20 ms 1132 KB Output is correct
10 Correct 1 ms 364 KB Output is correct
11 Correct 12 ms 1004 KB Output is correct
12 Correct 23 ms 1260 KB Output is correct
13 Correct 15 ms 1132 KB Output is correct
14 Correct 15 ms 1132 KB Output is correct
15 Incorrect 32 ms 2740 KB Wrong Answer [2]
16 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 364 KB Output is correct
2 Correct 1 ms 364 KB Output is correct
3 Correct 1 ms 364 KB Output is correct
4 Correct 1 ms 364 KB Output is correct
5 Correct 1 ms 364 KB Output is correct
6 Correct 2 ms 492 KB Output is correct
7 Correct 5 ms 492 KB Output is correct
8 Correct 9 ms 748 KB Output is correct
9 Correct 20 ms 1132 KB Output is correct
10 Correct 1 ms 364 KB Output is correct
11 Correct 12 ms 1004 KB Output is correct
12 Correct 23 ms 1260 KB Output is correct
13 Correct 15 ms 1132 KB Output is correct
14 Correct 15 ms 1132 KB Output is correct
15 Incorrect 32 ms 2740 KB Wrong Answer [2]
16 Halted 0 ms 0 KB -