제출 #761264

#제출 시각아이디문제언어결과실행 시간메모리
761264raul2008487메기 농장 (IOI22_fish)C++17
컴파일 에러
0 ms0 KiB
#include "fish.h"
#include<bits/stdc++.h>
using namespace std;
long long max_weights(int N, int M, std::vector<int> X, std::vector<int> Y, std::vector<int> W) {
    long long i,s1=0,s2=0;
    for(i=0;i<N;i++){
        if(x[i]==0){
            s1+=W[i];
        }
        else{
            s2+=W[i];
        }
    }
    return max(s1,s2);
}

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

fish.cpp: In function 'long long int max_weights(int, int, std::vector<int>, std::vector<int>, std::vector<int>)':
fish.cpp:7:12: error: 'x' was not declared in this scope
    7 |         if(x[i]==0){
      |            ^