# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
255245 | Vladikus004 | Zamjene (COCI16_zamjene) | C++14 | 2261 ms | 98552 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 <bits/stdc++.h>
#define inf 2e9
#define all(v) v.begin(), v.end()
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair <int, int> pii;
mt19937_64 rnd(42);
const int N = 1000000 + 3;
int n, q, a[N], p[N], ans_4, ans_3, cnt, b[N], sz[N];
ll code[N], sum[N], nsum[N];
map <ll, int> mp;
void init(){
for (int i = 0; i < n; i++){
p[i] = i;
sum[i] = code[a[i]];
nsum[i] = code[b[i]];
sz[i] = 1;
if (sum[i] == nsum[i]){
ans_3++;
}else{
ans_4 += mp[nsum[i] - sum[i]];
mp[sum[i] - nsum[i]]++;
}
}
}
int get_anc(int x){
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |