# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
768158 | caganyanmaz | Boxes with souvenirs (IOI15_boxes) | C++17 | 0 ms | 0 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bit/stdc++.h>
#define int int64_t
using namespace std;
map<int, int> left, right;
int mid;
void safe_insert(map<int, int>& m, int val)
{
if (m.find(val) == m.end())
m[val] = 0;
m[val]++;
}
int delivery(int32_t N, int32_t K, int32_t L, int32_t p[])
{
for (int i = 0; i < N; i++)
if (p[i] > L / 2)
safe_insert(right, p[i]);
if (p[i] < L / 2)
safe_insert(left, p[i]);
else
mid++;
return 0;
}