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

#TimeUsernameProblemLanguageResultExecution timeMemory
579946VanillaPacking Biscuits (IOI20_biscuits)C++17
0 / 100
1086 ms852 KiB
#include <bits/stdc++.h> #include "biscuits.h" using namespace std; typedef long long int64; bool check (int64 tg, int64 x, vector <int64> a) { vector <int64> b(x, 0); int64 n = a.size(); int64 curr = tg; for (int64 i = n - 1; i >= 0; i--){ for (int z = 0; z < 100; z++){ int j = 0; while (j < x && a[i]) { if (b[j] + (1 << i) <= tg) { b[j]+=(1 << i); a[i]--; } j++; } } } for (int i = 0; i < x; i++){ if (b[i] != tg) return 0; } return 1; } int64 count_tastiness(int64 x, vector<int64> a) { cout << "\n\n"; int64 rs = 1; for (int i = 1; i <= 100000; i++){ if (check(i, x, a)) rs++; } return rs; }

Compilation message (stderr)

biscuits.cpp: In function 'bool check(int64, int64, std::vector<long long int>)':
biscuits.cpp:9:8: warning: unused variable 'curr' [-Wunused-variable]
    9 |  int64 curr = tg;
      |        ^~~~
#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...