(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 #305541

#TimeUsernameProblemLanguageResultExecution timeMemory
305541myungwooPacking Biscuits (IOI20_biscuits)C++17
100 / 100
20 ms896 KiB
#include <bits/stdc++.h> #include "biscuits.h" using namespace std; #define debug(...) fprintf(stderr, __VA_ARGS__), fflush(stderr) typedef long long lld; lld count_tastiness(lld x, vector<lld> a) { vector <lld> status(63, 0); lld sum = 0; for (int i=0;i<63;i++){ if (i < a.size()) sum += a[i]<<i; status[i] = sum; } vector <lld> dp(63, 0); dp[0] = 1; for (int i=1;i<63;i++){ lld cur = sum; dp[i] = 1; for (int j=i;j--;){ cur = min(cur, status[j]); if (x <= cur>>j){ cur -= x<<j; dp[i] += dp[j]; } } } return dp.back(); }

Compilation message (stderr)

biscuits.cpp: In function 'lld count_tastiness(lld, std::vector<long long int>)':
biscuits.cpp:13:9: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   13 |   if (i < a.size()) sum += a[i]<<i;
      |       ~~^~~~~~~~~~
#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...