제출 #1241336

#제출 시각아이디문제언어결과실행 시간메모리
1241336lovrotWiring (IOI17_wiring)C++20
컴파일 에러
0 ms0 KiB
#include "wiring.h" #include <algorithm> #include <vector> #include <cstdio> #define PB push_back using namespace std; typedef long long ll; const int N = 210; ll long min_total_length(vector<int> r, vector<int> b) { for(; r.size() < b.size(); r.push_back(r.back())); for(; b.size() < r.size(); b.push_back(b.front())); ll ans = 0; for(int x : r) ans -= x; for(int x : b) ans += x; return ans; }

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

wiring.cpp:14:9: error: ambiguating new declaration of 'long int min_total_length(std::vector<int>, std::vector<int>)'
   14 | ll long min_total_length(vector<int> r, vector<int> b) {
      |         ^~~~~~~~~~~~~~~~
In file included from wiring.cpp:1:
wiring.h:3:11: note: old declaration 'long long int min_total_length(std::vector<int>, std::vector<int>)'
    3 | long long min_total_length(std::vector<int> r, std::vector<int> b);
      |           ^~~~~~~~~~~~~~~~