(UPD: 2024-12-04 14:48 UTC) Judge is not working due to Cloudflare incident. (URL) We can do nothing about it, sorry. After the incident is resolved, we will grade all submissions.

Submission #623644

#TimeUsernameProblemLanguageResultExecution timeMemory
623644JomnoiPacking Biscuits (IOI20_biscuits)C++17
0 / 100
1090 ms596 KiB
#include <bits/stdc++.h> #include "biscuits.h" using namespace std; const int MAX_N = 1e5 + 5; int K; long long X, ans; bool dp[2][MAX_N]; long long count_tastiness(long long x, vector <long long> a) { ans = 0; for(int i = 0; i <= 100000; i++) { dp[0][i] = dp[1][i] = false; } X = x, K = a.size(); dp[1][0] = true; for(int i = 0; i < K; i++) { int now = i % 2, pre = now ^ 1; for(int j = a[i]; j >= 0; j--) { for(int k = 100000; k >= (1ll<<i) * j; k--) { dp[now][k] |= dp[pre][k - (1ll<<i) * j]; } } } for(int i = 0; i <= 100000; i += x) { ans += dp[(K - 1) % 2][i]; } return ans; }
#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...