Submission #1055933

#TimeUsernameProblemLanguageResultExecution timeMemory
1055933amirhoseinfar1385메기 농장 (IOI22_fish)C++17
Compilation error
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 sum1=0,sum0=0,res=0,f=0; n=N; for(int i=0;i<n;i++){ res+=W[i]; if(X[i]==0){ sum0+=W[i]; }else if(X[i]==1){ sum1+=W[i]; }else{ f=1; } } if(f==0){ return max(sum1,sum0); } return res; }

Compilation message (stderr)

fish.cpp: In function 'long long int max_weights(int, int, std::vector<int>, std::vector<int>, std::vector<int>)':
fish.cpp:8:5: error: 'n' was not declared in this scope
    8 |     n=N;
      |     ^