Submission #777910

#TimeUsernameProblemLanguageResultExecution timeMemory
777910Mouad_oujCatfish Farm (IOI22_fish)C++17
0 / 100
73 ms9928 KiB
#include "fish.h"//sub2 #include <bits/stdc++.h> using namespace std; long long max_weights(int n, int m,vector<int> x,vector<int> y,vector<int> w) { long long tab1[n]={0},tab2[n]={0}; for(int a=0;a<m;a++) { if(x[a]==0) tab1[y[a]]+=w[a]; else tab2[y[a]]+=w[a]; } for(int a=1;a<n;a++) { tab1[a]+=tab1[a-1]; tab2[a]+=tab2[a-1]; } long long ans=max(tab1[n-1],tab2[n-1]); for(int a=0;a<n;a++) { ans=max(ans,tab1[a]+tab2[n-1]-tab2[a]); } return ans; }
#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...