# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
624402 | boris_mihov | Sum Zero (RMI20_sumzero) | C++14 | 766 ms | 20136 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 <unordered_map>
#include <algorithm>
#include <iostream>
#include <cassert>
#include <numeric>
#include <vector>
typedef long long llong;
const int MAXN = 400000 + 10;
const int MAXLOG = 3;
const int BASE = 100;
std::unordered_map < llong,int > cnt;
int sparse[MAXLOG][MAXN];
int n, q;
void buildSparse()
{
for (int log = 1 ; log <= MAXLOG-1 ; ++log)
{
sparse[log][0] = -1;
for (int i = 1 ; i <= n ; ++i)
{
sparse[log][i] = i;
for (int j = 1 ; j <= BASE ; ++j)
{
sparse[log][i] = sparse[log-1][sparse[log][i]];
if (sparse[log][i] == -1) break;
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |