Submission #1125497

#TimeUsernameProblemLanguageResultExecution timeMemory
1125497zNatsumiCatfish Farm (IOI22_fish)C++20
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; const int N = 1e5 + 5, M = 3e5 + 5; int n, m; struct info{ int x, y, w; info(){} info(int x, int y, int w): x(x), y(y), w(w) {} } fish[M]; namespace sub1{ long long solve(){ long long res = 0LL; for(int i = 0; i < m; i++) res += fish[i].w; return res; } } int64_t max_weights(int N, int _M, vector<int> _X, vector<int> _Y, vector<int> _W){ n = _N; m = _M; for(int i = 0; i < m; i++) fish[i] = info(_X[i], _Y[i], _W[i]); bool flag1 = true; for(int i = 0; i < m; i++) if(fish[i].x & 1){ flag1 = false; break; } if(flag1) return sub1::solve(); return 0; }

Compilation message (stderr)

fish.cpp: In function 'int64_t max_weights(int, int, std::vector<int>, std::vector<int>, std::vector<int>)':
fish.cpp:24:7: error: '_N' was not declared in this scope; did you mean 'N'?
   24 |   n = _N; m = _M;
      |       ^~
      |       N