제출 #1125495

#제출 시각아이디문제언어결과실행 시간메모리
1125495zNatsumi메기 농장 (IOI22_fish)C++20
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> #include "fish.h" using namespace std; const int N = 1e5 + 5, M = 3e5 + 5; int n, m; struct info{ int x, y, w; info(){} info(int x, int y, int w): x(x), y(y), w(w) {} } fish[M]; namespace sub1{ long long solve(){ long long res = 0LL; for(int i = 0; i < m; i++) res += fish[i].w; return res; } } int64_t max_weights(int _N, int _M, vector<int> _X, vector<int> _Y, vector<int> _W){ n = _N; m = _M; for(int i = 0; i < m; i++) fish[i] = info(_X[i], _Y[i], _W[i]); bool flag1 = true; for(int i = 0; i < m; i++) if(fish[i].x & 1){ flag1 = false; break; } if(flag1) return sub1::solve(); return 0; } //#define zNatsumi #ifdef zNatsumi int32_t main(){ cin.tie(0)->sync_with_stdio(0); #define task "test" if(fopen(task ".inp", "r")){ freopen(task ".inp", "r", stdin); freopen(task ".out", "w", stdout); } int n, m; cin >> n >> m; vector<int> x(m), y(m), w(m); for(int i = 0; i < m; i++) cin >> x[i] >> y[i] >> w[i]; cout << max_weights(n, m, x, y, w); } #endif

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

fish.cpp:24:9: error: ambiguating new declaration of 'int64_t max_weights(int, int, std::vector<int>, std::vector<int>, std::vector<int>)'
   24 | int64_t max_weights(int _N, int _M, vector<int> _X, vector<int> _Y, vector<int> _W){
      |         ^~~~~~~~~~~
In file included from fish.cpp:2:
fish.h:3:11: note: old declaration 'long long int max_weights(int, int, std::vector<int>, std::vector<int>, std::vector<int>)'
    3 | long long max_weights(int N, int M, std::vector<int> X, std::vector<int> Y,
      |           ^~~~~~~~~~~