제출 #625480

#제출 시각아이디문제언어결과실행 시간메모리
625480I_love_Hoang_Yen메기 농장 (IOI22_fish)C++17
컴파일 에러
0 ms0 KiB
#include "bits/stdc++.h" using namespace std; #define int long long struct Fish { int col, row; int weight; }; int sub1(const std::vector<Fish>& fishes) { int res = 0; for (const auto& fish : fishes) { res += fish.weight; } return res; } int solve(int n, const std::vector<Fish>& fishes) { if (std::all_of( fishes.begin(), fishes.end(), [] (const Fish& f) { return f.col % 2 == 0; })) { return sub1(fishes); } return sub1(fishes); } int max_weights( int n, int nFish, std::vector<int> x, std::vector<int> y, std::vector<int> w) { std::vector<Fish> fishes; for (int i = 0; i < n; ++i) { fishes.push_back({x[i], y[i], w[i]}); } return solve(n, fishes); }

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

/usr/bin/ld: /tmp/ccw6FGBg.o: in function `main':
grader.cpp:(.text.startup+0x25e): undefined reference to `max_weights(int, int, std::vector<int, std::allocator<int> >, std::vector<int, std::allocator<int> >, std::vector<int, std::allocator<int> >)'
collect2: error: ld returned 1 exit status