# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
579676 | 2022-06-19T15:37:29 Z | wdjpng | Uplifting Excursion (BOI22_vault) | C++17 | 758 ms | 5540 KB |
#include <bits/stdc++.h> #define int long long #define rep(i,n) for(int i = 0; i < n; i++) #define per(i,n) for(int i = n-1; i >=0; i--) using namespace std; signed main() { int m,l; cin>>m>>l; int maxl=max(l+1,(m)*(m+1)/2*50)+100000; vector<int>dp(2*maxl+1, -1); dp[maxl]=0; for(int cl = -m; cl <= m; cl++) { int a; cin>>a; rep(whatever,a) { if(cl>0) { per(i,2*maxl+1) { if(i-cl<0||i-cl>=dp.size()||dp[i-cl]==-1) continue; dp[i]=max(dp[i], dp[i-cl]+1); } } else rep(i,2*maxl+1) { if(i-cl<0||i-cl>=dp.size()||dp[i-cl]==-1) continue; dp[i]=max(dp[i], dp[i-cl]+1); } } } assert(l+maxl<dp.size()); if(dp[l+maxl]>0) cout<<dp[l+maxl]<<'\n'; else cout<<"impossible\n"; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 3 ms | 1876 KB | Output is correct |
2 | Correct | 3 ms | 1876 KB | Output is correct |
3 | Correct | 2 ms | 1876 KB | Output is correct |
4 | Correct | 16 ms | 1920 KB | Output is correct |
5 | Runtime error | 758 ms | 5540 KB | Execution killed with signal 6 |
6 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 3 ms | 1876 KB | Output is correct |
2 | Correct | 3 ms | 1876 KB | Output is correct |
3 | Correct | 2 ms | 1876 KB | Output is correct |
4 | Correct | 16 ms | 1920 KB | Output is correct |
5 | Runtime error | 758 ms | 5540 KB | Execution killed with signal 6 |
6 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 13 ms | 1876 KB | Output is correct |
2 | Runtime error | 2 ms | 492 KB | Execution killed with signal 6 |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 13 ms | 1876 KB | Output is correct |
2 | Runtime error | 2 ms | 492 KB | Execution killed with signal 6 |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 13 ms | 1876 KB | Output is correct |
2 | Runtime error | 2 ms | 492 KB | Execution killed with signal 6 |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 3 ms | 1876 KB | Output is correct |
2 | Correct | 3 ms | 1876 KB | Output is correct |
3 | Correct | 2 ms | 1876 KB | Output is correct |
4 | Correct | 16 ms | 1920 KB | Output is correct |
5 | Runtime error | 758 ms | 5540 KB | Execution killed with signal 6 |
6 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 13 ms | 1876 KB | Output is correct |
2 | Runtime error | 2 ms | 492 KB | Execution killed with signal 6 |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 3 ms | 1876 KB | Output is correct |
2 | Correct | 3 ms | 1876 KB | Output is correct |
3 | Correct | 2 ms | 1876 KB | Output is correct |
4 | Correct | 16 ms | 1920 KB | Output is correct |
5 | Runtime error | 758 ms | 5540 KB | Execution killed with signal 6 |
6 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 13 ms | 1876 KB | Output is correct |
2 | Runtime error | 2 ms | 492 KB | Execution killed with signal 6 |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 3 ms | 1876 KB | Output is correct |
2 | Correct | 3 ms | 1876 KB | Output is correct |
3 | Correct | 2 ms | 1876 KB | Output is correct |
4 | Correct | 16 ms | 1920 KB | Output is correct |
5 | Runtime error | 758 ms | 5540 KB | Execution killed with signal 6 |
6 | Halted | 0 ms | 0 KB | - |