# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
164837 | ly20 | 역사적 조사 (JOI14_historical) | C++17 | 22 ms | 888 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>
using namespace std;
const int MAXN = 112345;
const int sz = sqrt(MAXN) + 10;
int v[MAXN];
long long marc[MAXN];
long long mrk[sz][MAXN];
int sq[MAXN];
map <int, int> mp;
set <int> s;
set <int> :: iterator it;
int ini[sz], fim[sz];
long long rs[sz][sz];
long long imp[MAXN];
int main() {
int n, q;
scanf("%d %d", &n, &q);
int par = (n - 1) / sz + 1;
for(int i = 0; i < n; i++) {
scanf("%d", &v[i]);
s.insert(v[i]);
}
int temp = 0;
for(it = s.begin(); it != s.end(); it++) {
mp[*it] = temp;
imp[temp] = *it;
temp++;
}
for(int i = 0; i < n; i++) {
v[i] = mp[v[i]];
Compilation message (stderr)
# | 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... |