Submission #1055702

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
10557022024-08-13 03:53:39vjudge1Catfish Farm (IOI22_fish)C++17
52 / 100
597 ms458832 KiB
#include "fish.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
set<int>fishies[3002];
ll FIS2;
ll dp[3010][2][3010],fishiess[3010][3010];
ll first[3010][3010];
ll sec[3010][301],third[3010][3010],overal[3010][3010];
inline ll ones(int col,int len){
return fishiess[col][len];
}
ll max_weights(int N,int M,vector<int> X,vector<int> Y,vector<int> W) {
for(int i=0;i<M;i++)
fishies[X[i]+1].insert(Y[i]+1),
fishiess[X[i]+1][Y[i]+1]=W[i];
for(int i=1;i<=N;i++)
for(int j=1;j<=N+1;j++)
fishiess[i][j]+=fishiess[i][j-1];
for(int i=1;i<=N;i++)
fishies[i].insert(1),
fishies[i].insert(N+1);
fishies[N+1].insert(0);
for(auto i:fishies[1])
dp[1][1][i-1]=ones(2,i-1);
for(int j=0;j<=N;j++){
overal[1][j]=first[1][j]=max(dp[1][0][j],dp[1][1][j]);
first[1][j]-=ones(2,j);sec[1][j]=dp[1][0][j];
third[1][j]=dp[1][1][j]-ones(1,j)-ones(2,j);
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
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...