답안 #956433

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
956433 2024-04-01T21:31:38 Z nigus Minerals (JOI19_minerals) C++14
컴파일 오류
0 ms 0 KB
#include <bits/stdc++.h>
#include "minerals.h"

void Solve(int N)
{   
    int n = N;
    vector<int> done(2*n, 0);
    for(int c1 = 0; c1 < 2*n; c1++){
        if(done[c1] == 0){
            Query(c1+1);
            for(int c2 = c1+1; c2 < 2*n; c2++){
                if(done[c2] == 0){
                    int temp = Query(c2+1);
                    if(temp == 1){
                        Answer(c1+1,c2+1);
                        done[c1] = 1;
                        done[c2] = 1;
                    }
                    Query(c2+1);
                    if(done[c1] == 1)break;
                }
            }
            Query(c1+1);
        }
    }
}

Compilation message

minerals.cpp: In function 'void Solve(int)':
minerals.cpp:7:5: error: 'vector' was not declared in this scope; did you mean 'std::vector'?
    7 |     vector<int> done(2*n, 0);
      |     ^~~~~~
      |     std::vector
In file included from /usr/include/c++/10/vector:67,
                 from /usr/include/c++/10/queue:61,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:86,
                 from minerals.cpp:1:
/usr/include/c++/10/bits/stl_vector.h:389:11: note: 'std::vector' declared here
  389 |     class vector : protected _Vector_base<_Tp, _Alloc>
      |           ^~~~~~
minerals.cpp:7:12: error: expected primary-expression before 'int'
    7 |     vector<int> done(2*n, 0);
      |            ^~~
minerals.cpp:9:12: error: 'done' was not declared in this scope
    9 |         if(done[c1] == 0){
      |            ^~~~