# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
625990 | sword060 | Catfish Farm (IOI22_fish) | C++17 | 117 ms | 11480 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
#include "fish.h"
using namespace std;
long long max_weights(int x,int k,vector<int> a,vector<int> b,vector<int> c){
vector<pair<int,int>>l[2];
long long ans=0,cur=0;
for(int i=0;i<k;i++){
l[(a[i]%2)].push_back({b[i],c[i]});
if(a[i]%2)cur+=c[i];
}
sort(l[0].begin(),l[0].end());
sort(l[1].begin(),l[1].end());
ans=cur;
int j=0;
for(int i=0;i<(int)l[0].size();i++){
cur+=l[0][i].second;
while(j<l[1].size()&&l[1][j].first<=l[0][i].first){
cur-=l[1][j].second;
j++;
}
ans=max(ans,cur);
}
return ans;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |