Submission #921451

# Submission time Handle Problem Language Result Execution time Memory
921451 2024-02-03T21:43:00 Z ksujay2 Packing Biscuits (IOI20_biscuits) C++17
0 / 100
1000 ms 196664 KB
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
 
ll count_tastiness(ll x, vector<ll> a) {
    a.resize(60);
    map<pair<int, ll>, ll> mp;
    function<ll(int, ll)> f = [&] (int i, ll y) {
        if(i < 0) return (ll)(y == 0);
        if(mp.count({i, y})) return mp[{i, y}];
        y -= a[i] * (1LL << i);
        mp[{i, y}] = f(i - 1, max(0ll, y)) + ((x < (1LL << (60 - i))) ? f(i - 1, max(0ll, y + x * (1LL << i))) : 0);
        return mp[{i, y}];
    };
    return f(59, 0);
}
# Verdict Execution time Memory Grader output
1 Execution timed out 1059 ms 192472 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1022 ms 180816 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1060 ms 196664 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1054 ms 189592 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1059 ms 192472 KB Time limit exceeded
2 Halted 0 ms 0 KB -