Submission #714181

# Submission time Handle Problem Language Result Execution time Memory
714181 2023-03-24T05:53:14 Z vjudge1 Uplifting Excursion (BOI22_vault) C++17
0 / 100
5000 ms 304 KB
#include <bits/stdc++.h>

using namespace std;
vector<long long>v;
int m;
long long l, mx = -1;
void rec(long long uplift, int indx, long long cnt){
    if(uplift == l && indx == 2 * m + 1){
        mx = max(mx, cnt);
        return;
    }
    else if(indx == 2 * m + 1)return;
    for(int i = 0;i <= v[indx];++i){
        rec(uplift + i * (indx - m), indx + 1, cnt + i);
    }
}
int main()
{
    cin >> m >> l;
    v.resize(2 * m + 1);
    for(int i = 0;i < 2 * m + 1;++i)cin >> v[i];
    rec(0, 0, 0);
    if(mx == -1)cout << "impossible";
    else cout << mx;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 304 KB Output is correct
2 Correct 0 ms 304 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 327 ms 296 KB Output is correct
5 Execution timed out 5033 ms 212 KB Time limit exceeded
6 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 304 KB Output is correct
2 Correct 0 ms 304 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 327 ms 296 KB Output is correct
5 Execution timed out 5033 ms 212 KB Time limit exceeded
6 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 339 ms 280 KB Output is correct
2 Execution timed out 5082 ms 212 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 339 ms 280 KB Output is correct
2 Execution timed out 5082 ms 212 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 339 ms 280 KB Output is correct
2 Execution timed out 5082 ms 212 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 304 KB Output is correct
2 Correct 0 ms 304 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 327 ms 296 KB Output is correct
5 Execution timed out 5033 ms 212 KB Time limit exceeded
6 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 339 ms 280 KB Output is correct
2 Execution timed out 5082 ms 212 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 304 KB Output is correct
2 Correct 0 ms 304 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 327 ms 296 KB Output is correct
5 Execution timed out 5033 ms 212 KB Time limit exceeded
6 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 339 ms 280 KB Output is correct
2 Execution timed out 5082 ms 212 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 304 KB Output is correct
2 Correct 0 ms 304 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 327 ms 296 KB Output is correct
5 Execution timed out 5033 ms 212 KB Time limit exceeded
6 Halted 0 ms 0 KB -