Submission #653545

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
6535452022-10-27 08:45:34atigunUplifting Excursion (BOI22_vault)C++14
5 / 100
5061 ms6936 KiB
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn = 75;
int M;
ll L;
vector<int> pos(maxn+5), neg(maxn+5);
void solve(){
cin >> M >> L;
for(int i = 1; i <= M; i++)
cin >> neg[M-i+1];
ll ans;
cin >> ans;
for(int i = 1; i <= M; i++)
cin >> pos[i];
int maxn3 = maxn*maxn*maxn;
vector<ll> knapsack1(maxn3+5, -1e18);
knapsack1[0] = 0;
for(int i = 1; i <= M; i++){
for(int make = maxn3; make >= 0; make--){
for(int use = 1; use <= pos[i] && use*1ll*i <= maxn3; use++){
if(use*i <= make && knapsack1[make-use*i] != -1e18)
knapsack1[make] = max(knapsack1[make], knapsack1[make-use*i]+use);
}
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
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...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...