Submission #629066

#TimeUsernameProblemLanguageResultExecution timeMemory
629066Justin1Catfish Farm (IOI22_fish)C++17
Compilation error
0 ms0 KiB
#include "fish.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; ll ps1[100005], ps2[100005]; long long max_weights(int N, int M, std::vector<int> X, std::vector<int> Y, std::vector<int> W) { for (int i = 0; i < M; i++) { if (X[i] == 0) ps1[Y[i]] += W[i]; else ps2[Y[i]] += W[i]; } for (int i = 1; i < N; i++) ps1[i] += ps1[i-1]; for (int i = N-1; i >= 0; i--) ps2[i] += ps2[i+1]; ll ans = ps[0]; for (int i = 0; i < N; i++) ans = max(ans,ps1[i] + ps2[i+1]); return ans; }

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:16:11: error: 'ps' was not declared in this scope; did you mean 'ps2'?
   16 |  ll ans = ps[0];
      |           ^~
      |           ps2