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 "fish.h"
#include <bits/stdc++.h>
#define fs first
#define sc second
#define p_q priority_queue
using namespace std;
long long max_weights(int n, int m, vector<int> x, vector<int> y, vector<int> w) {
long long ans=0;
vector<vector<pair<int,int> > > v(n);
for(int i=0;i<m;i++){
v[x[i]].push_back({y[i],w[i]});
}
for(int i=0;i<n;i++){
if(v[i].size() && ((i-1>=0 && !v[i-1].size()) || (i+1<n && !v[i+1].size()))){
ans+=v[i][0].sc;
}
}
return ans;
}
# | 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... |