Submission #777913

#TimeUsernameProblemLanguageResultExecution timeMemory
777913Mouad_oujCatfish Farm (IOI22_fish)C++17
6 / 100
71 ms8808 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]); if(n>2) { for(int a=0;a<n;a++) { ans=max(ans,tab1[a]+tab2[n-1]-tab2[a]); } return ans; } else 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...