제출 #1362601

#제출 시각아이디문제언어결과실행 시간메모리
1362601opeleklanos마술쇼 (APIO24_show)C++20
컴파일 에러
0 ms0 KiB
#include <iostream>
#include <vector>
using namespace std;

#include "Alice.h"

vector<pair<int, int>> Alice(){
    int x = setN(5000);
    vector<pair<int, int>> ans;
    for(int i = 1; i<=5000; i++){
        if(i!=x) ans.push_back({x, i});
    }
    return ans;
}
#include <iostream>
#include <vector>
using namespace std;

#include "Bob.h"

int Bob(vector<pair<int, int>> edges){
    int a = edges[0].first;
    int b = edges[0].second;
    int c = edges[1].first;
    int d = edges[1].second;
    if(a == c) return a;
    if(b == c) return b;
    if(a == d) return a;
    if(b == d) return b;
}

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

# 2번째 컴파일 단계

Bob.cpp:7:5: error: ambiguating new declaration of 'int Bob(std::vector<std::pair<int, int> >)'
    7 | int Bob(vector<pair<int, int>> edges){
      |     ^~~
In file included from Bob.cpp:5:
Bob.h:3:11: note: old declaration 'long long int Bob(std::vector<std::pair<int, int> >)'
    3 | long long Bob(std::vector<std::pair<int,int>> V);
      |           ^~~
Bob.cpp: In function 'int Bob(std::vector<std::pair<int, int> >)':
Bob.cpp:16:1: warning: control reaches end of non-void function [-Wreturn-type]
   16 | }
      | ^