답안 #1081530

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1081530 2024-08-30T07:06:42 Z djs100201 마술쇼 (APIO24_show) C++17
컴파일 오류
0 ms 0 KB
#include<bits/stdc++.h>
#include "Alice.h"
vector<pair<int,int>> Alice(){
	// add your code here
	
	// change below into your code
    long long x = setN(5000);
    vector<pair<int,int>>res;
    for(int i=1;i<=5000;i++)idx[i]=i;
    for(int i=2;i<5000;i++){
        bit[i]=(++base)%60;
        //0 ~ 59
    }
    for(int i=2;i<n;i++){
        if((1ll<<bit[i]) & x){
            res.push_back({i,5000});
        }
        else{
            res.push_back({1,i});
        }
    }
    res.push_back({1,5000});
    return res;
}
#include<bits/stdc++.h>
#include "Bob.h"
long long Bob(vector<pair<int,int>> V){
	// add your code here
    ll res=0;
	for(auto [a,b]:V){
        if(a==1 && b==5000)continue;
        if(b==5000){
            res|=(1ll<<bit[a]);
        }
    }
    return res; // change this into your code
}

Compilation message

Alice.cpp:3:1: error: 'vector' does not name a type
    3 | vector<pair<int,int>> Alice(){
      | ^~~~~~

Bob.cpp:3:15: error: 'long long int Bob' redeclared as different kind of entity
    3 | long long Bob(vector<pair<int,int>> V){
      |               ^~~~~~
In file included from Bob.cpp:2:
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: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++/10/vector:67,
                 from /usr/include/c++/10/functional:62,
                 from /usr/include/c++/10/pstl/glue_algorithm_defs.h:13,
                 from /usr/include/c++/10/algorithm:74,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
                 from Bob.cpp:1:
/usr/include/c++/10/bits/stl_vector.h:389:11: note:   'std::vector'
  389 |     class vector : protected _Vector_base<_Tp, _Alloc>
      |           ^~~~~~
In file included from /usr/include/c++/10/functional:62,
                 from /usr/include/c++/10/pstl/glue_algorithm_defs.h:13,
                 from /usr/include/c++/10/algorithm:74,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
                 from Bob.cpp:1:
/usr/include/c++/10/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
In file included from /usr/include/c++/10/bits/stl_algobase.h:64,
                 from /usr/include/c++/10/bits/specfun.h:45,
                 from /usr/include/c++/10/cmath:1927,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:41,
                 from Bob.cpp:1:
/usr/include/c++/10/bits/stl_pair.h:211:12: note: 'std::pair' declared here
  211 |     struct pair
      |            ^~~~
Bob.cpp:3:27: error: expected primary-expression before 'int'
    3 | long long Bob(vector<pair<int,int>> V){
      |                           ^~~
Bob.cpp:3:31: error: expected primary-expression before 'int'
    3 | long long Bob(vector<pair<int,int>> V){
      |                               ^~~