답안 #832421

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
832421 2023-08-21T10:13:52 Z NothingXD 메기 농장 (IOI22_fish) C++17
컴파일 오류
0 ms 0 KB
#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) {
	ll ans = 0
	for (int i = 0; i < M; i++){
		ans += W[i];
	}
	return ans;
}

Compilation message

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