# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
305943 | 2020-09-24T06:34:42 Z | llaki | Packing Biscuits (IOI20_biscuits) | C++17 | 1000 ms | 16120 KB |
#include <vector> #include <map> #include "biscuits.h" long long count_tastiness(long long x, std::vector<long long> a) { std::map<long long, long long> freq; freq[a[0]] = 1; for (int pos = 0; pos < a.size() - 1; pos++) { std::map<long long, long long> map; for (const auto &[y, value]: freq) { long long val = a[pos + 1] + y / 2; long long oldFreq = 0; if (freq.find(val) != freq.end()) { oldFreq = freq[val]; } map[val] = oldFreq + freq[y]; if (y >= x) { val = a[pos + 1] + (y - x) / 2; oldFreq = 0; if (freq.find(val) != freq.end()) { oldFreq = freq[val]; } map[val] = oldFreq + freq[y]; } } freq = map; } long long ans = 0; for (const auto &[y, value]: freq) { ans += value * (y / x + 1); } return ans; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 256 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 288 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 384 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 384 KB | Output is correct |
2 | Execution timed out | 1093 ms | 16120 KB | Time limit exceeded |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 256 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |