# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1077774 | LIF | Uplifting Excursion (BOI22_vault) | C++14 | 5049 ms | 4152 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<bits/stdc++.h>
using namespace std;
long long int m,dp[300005];
long long int L;
int num[200005];
int val[200005];
int su = 0;
int main()
{
cin>>m>>L;
for(int i=1;i<=m*2+1;i++)
{
cin>>num[i];
val[i] = i-m-1;
su += num[i];
}
for(int i=0;i<=300000;i++)dp[i] = -1;
dp[100000] = 0; //遍移量為1000000
for (int i=m+1;i<=m*2+1;i++)
{
for(int j=1;j<=num[i];j++)
{
for(int k=200000;k>=1;k--)
{
if(k >= val[i])
{
if(dp[k-val[i]] == -1)continue;
if(dp[k] == -1)
{
dp[k] = dp[k-val[i]] + 1;
# | 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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |