제출 #832420

#제출 시각아이디문제언어결과실행 시간메모리
832420NothingXDCatfish Farm (IOI22_fish)C++17
컴파일 에러
0 ms0 KiB
#include "fish.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int,int> pii; typedef pair<ll,ll> pll; void debug_out(){cerr << endl;} template<typename Head, typename... Tail> void debug_out(Head H, Tail... T){ cerr << H << ' '; debug_out(T...); } #define debug(...) cerr << "(" << #__VA_ARGS__ << "): ", debug_out(__VA_ARGS__) #define F first #define S second #define all(x) x.begin(), x.end() #define MP(x, y) make_pair(x, y) const int maxn = 1e5 + 10; ll max_weights(int N, int M, vector<int> X, vector<int> Y, vector<int> W) { n = N, m = M; ll ans = 0 for (int i = 0; i < m; i++){ ans += W[i]; } return ans; }

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

fish.cpp: In function 'll max_weights(int, int, std::vector<int>, std::vector<int>, std::vector<int>)':
fish.cpp:26:2: error: 'n' was not declared in this scope
   26 |  n = N, m = M;
      |  ^
fish.cpp:26:9: error: 'm' was not declared in this scope
   26 |  n = N, m = M;
      |         ^
fish.cpp:28:2: error: expected ',' or ';' before 'for'
   28 |  for (int i = 0; i < m; i++){
      |  ^~~
fish.cpp:28:18: error: 'i' was not declared in this scope
   28 |  for (int i = 0; i < m; i++){
      |                  ^