Submission #821981

#TimeUsernameProblemLanguageResultExecution timeMemory
821981boyliguanhanCatfish Farm (IOI22_fish)C++17
0 / 100
35 ms4756 KiB
#include "fish.h" #include <vector> using namespace std; int fish[2][100100]; long long max_weights(int N, int M, vector<int> X, vector<int> Y, vector<int> W) { for(int i = 0; i < M; i++) fish[X[i]][Y[i]+1]=W[i]; for(int i = 0; i < 2; i++) for(int j = 1; j < 100100; j++) fish[i][j]+=fish[i][j-1]; if(N>2) { int ans = 0; for(int i = 0; i <= N; i++) ans = max(ans, fish[1][100000]-fish[1][i]+fish[0][i]); return ans; } else { return max(fish[0][100000], fish[1][100000]); } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...