제출 #1125497

#제출 시각아이디문제언어결과실행 시간메모리
1125497zNatsumi메기 농장 (IOI22_fish)C++20
컴파일 에러
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;
}

컴파일 시 표준 에러 (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