제출 #628466

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
6284662022-08-13 12:15:58guangxuan메기 농장 (IOI22_fish)C++17
100 / 100
213 ms27536 KiB
#include "fish.h"
#define F first
#define S second
#include <bits/stdc++.h>
typedef long long ll;
const ll INF= 1LL<<60;
using namespace std;
typedef pair<int, ll> pil;
long long max_weights(int N, int M, std::vector<int> X, vector<int> Y,
vector<int> W) {
for(int i=0;i<M;i++){
Y[i]+=1;
}
vector<pil> rs[N];
for(int i=0;i<M;i++){
rs[X[i]].emplace_back(Y[i],W[i]);
}
for(int i=0;i<N;i++){
rs[i].emplace_back(0,0);
sort(rs[i].begin(),rs[i].end());
rs[i].emplace_back(N+2,0);
for(int j=1;j<(int)rs[i].size();j++){
rs[i][j].S+=rs[i][j-1].S;
}
}
ll dp[2][3][N+2]; // (0, h[i-1]), (h[i-1] <= h[i], h[i]), (h[i-1]>h[i], h[i])
memset(dp,0,sizeof dp);
for(int i=0,k=0;i<(int)rs[0].size();i++){
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#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...