# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
625929 | haojiandan | Catfish Farm (IOI22_fish) | C++17 | 323 ms | 52964 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 "fish.h"
#include <bits/stdc++.h>
using namespace std;
#define MP make_pair
typedef long long ll;
const int maxn=(1e5)+10;
int n,m;
vector<pair<int,int> > vec[maxn];
vector<int> pos[maxn];
vector<ll> dp[maxn][2];
vector<ll> sum[maxn];
ll S(int i,int j) {
j=lower_bound(vec[i].begin(),vec[i].end(),MP(j+1,0))-vec[i].begin()-1;
if (j<0) return 0;
return sum[i][j];
}
const ll INF=1e18;
void chkmax(ll &x,ll y) { if (x<y) x=y; }
ll max_weights(int _n,int _m,vector<int> X,vector<int> Y,vector<int> W) {
n=_n,m=_m;
for (int i=0;i<m;i++) Y[i]++,vec[X[i]].push_back(MP(Y[i],W[i]));
for (int i=0;i<n;i++) {
sort(vec[i].begin(),vec[i].end());
ll pre=0; pos[i].push_back(0);
for (int j=0;j<vec[i].size();j++) {
pre+=vec[i][j].second;
sum[i].push_back(pre);
int p=vec[i][j].first;
if (i>0) pos[i-1].push_back(p);
pos[i].push_back(p-1);
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... |