제출 #1294492

#제출 시각아이디문제언어결과실행 시간메모리
1294492eri16마술쇼 (APIO24_show)C++20
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; #include "Alice.h" vector<pair<int, int>> Alice(){ long long ans; ans=setN(4999); vector <pair<int,int>> p; ans--; for (int i=1; i<=2499; i++){ p.push_back({1,ans/5000}); } for (int i=2500; i<=4998; i++){ p.push_back({2,ans%5000}); } return p; }
#include "Bob.h" long long Bob(vector<pair<int, int>> V){ long long n1=-1,n2=-1,warn=0; for (int i=0; i<V.size(); i++){ if (V[i].first==1 && V[i].second==2){warn=1;} else if (V[i].first==2){n2==V[i].second;if (warn==1){warn=0;n1=2;}} else if (V[i].first==0){ if (V[i].second==1){n1=0;if (warn==1){warn=0;n2=2;}} else if (V[i].second==2){n1=0;if (warn==1){warn=0;n1=2;}} } else{ n1=V[i].second; if (warn==1){ warn=0; n2=2; } } } return n1*5000+n2+1; }

컴파일 시 표준 에러 (stderr) 메시지

# 2번째 컴파일 단계

Bob.cpp:3:22: error: 'pair' was not declared in this scope; did you mean 'std::pair'?
    3 | long long Bob(vector<pair<int, int>> V){
      |                      ^~~~
      |                      std::pair
In file included from /usr/include/c++/13/bits/stl_algobase.h:64,
                 from /usr/include/c++/13/vector:62,
                 from Bob.h:1,
                 from Bob.cpp:1:
/usr/include/c++/13/bits/stl_pair.h:187:12: note: 'std::pair' declared here
  187 |     struct pair
      |            ^~~~
Bob.cpp:3:22: error: 'pair' was not declared in this scope; did you mean 'std::pair'?
    3 | long long Bob(vector<pair<int, int>> V){
      |                      ^~~~
      |                      std::pair
/usr/include/c++/13/bits/stl_pair.h:187:12: note: 'std::pair' declared here
  187 |     struct pair
      |            ^~~~
Bob.cpp:3:22: error: 'pair' was not declared in this scope; did you mean 'std::pair'?
    3 | long long Bob(vector<pair<int, int>> V){
      |                      ^~~~
      |                      std::pair
/usr/include/c++/13/bits/stl_pair.h:187:12: note: 'std::pair' declared here
  187 |     struct pair
      |            ^~~~
Bob.cpp:3:22: error: 'pair' was not declared in this scope; did you mean 'std::pair'?
    3 | long long Bob(vector<pair<int, int>> V){
      |                      ^~~~
      |                      std::pair
/usr/include/c++/13/bits/stl_pair.h:187:12: note: 'std::pair' declared here
  187 |     struct pair
      |            ^~~~
Bob.cpp:3:15: error: 'long long int Bob' redeclared as different kind of entity
    3 | long long Bob(vector<pair<int, int>> V){
      |               ^~~~~~
Bob.h:3:11: note: previous declaration 'long long int Bob(std::vector<std::pair<int, int> >)'
    3 | long long Bob(std::vector<std::pair<int,int>> V);
      |           ^~~
Bob.cpp:3:22: error: 'pair' was not declared in this scope; did you mean 'std::pair'?
    3 | long long Bob(vector<pair<int, int>> V){
      |                      ^~~~
      |                      std::pair
/usr/include/c++/13/bits/stl_pair.h:187:12: note: 'std::pair' declared here
  187 |     struct pair
      |            ^~~~
Bob.cpp:3:22: error: 'pair' was not declared in this scope; did you mean 'std::pair'?
    3 | long long Bob(vector<pair<int, int>> V){
      |                      ^~~~
      |                      std::pair
/usr/include/c++/13/bits/stl_pair.h:187:12: note: 'std::pair' declared here
  187 |     struct pair
      |            ^~~~
Bob.cpp:3:22: error: 'pair' was not declared in this scope; did you mean 'std::pair'?
    3 | long long Bob(vector<pair<int, int>> V){
      |                      ^~~~
      |                      std::pair
/usr/include/c++/13/bits/stl_pair.h:187:12: note: 'std::pair' declared here
  187 |     struct pair
      |            ^~~~
Bob.cpp:3:22: error: 'pair' was not declared in this scope; did you mean 'std::pair'?
    3 | long long Bob(vector<pair<int, int>> V){
      |                      ^~~~
      |                      std::pair
/usr/include/c++/13/bits/stl_pair.h:187:12: note: 'std::pair' declared here
  187 |     struct pair
      |            ^~~~
Bob.cpp:3:22: error: 'pair' was not declared in this scope; did you mean 'std::pair'?
    3 | long long Bob(vector<pair<int, int>> V){
      |                      ^~~~
      |                      std::pair
/usr/include/c++/13/bits/stl_pair.h:187:12: note: 'std::pair' declared here
  187 |     struct pair
      |            ^~~~
Bob.cpp:3:15: error: 'vector' was not declared in this scope
    3 | long long Bob(vector<pair<int, int>> V){
      |               ^~~~~~
Bob.cpp:3:15: note: suggested alternatives:
In file included from /usr/include/c++/13/vector:66:
/usr/include/c++/13/bits/stl_vector.h:428:11: note:   'std::vector'
  428 |     class vector : protected _Vector_base<_Tp, _Alloc>
      |           ^~~~~~
/usr/include/c++/13/vector:86:13: note:   'std::pmr::vector'
   86 |       using vector = std::vector<_Tp, polymorphic_allocator<_Tp>>;
      |             ^~~~~~
Bob.cpp:3:22: error: 'pair' was not declared in this scope; did you mean 'std::pair'?
    3 | long long Bob(vector<pair<int, int>> V){
      |                      ^~~~
      |                      std::pair
/usr/include/c++/13/bits/stl_pair.h:187:12: note: 'std::pair' declared here
  187 |     struct pair
      |            ^~~~
Bob.cpp:3:27: error: expected primary-expression before 'int'
    3 | long long Bob(vector<pair<int, int>> V){
      |                           ^~~
Bob.cpp:3:32: error: expected primary-expression before 'int'
    3 | long long Bob(vector<pair<int, int>> V){
      |                                ^~~