# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
72183 | 내일_개학이다_ㅠㅠ (#118) | Easy Data Structure Problem (FXCUP3_easy) | C++17 | 7 ms | 1892 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;
#define pp 131072
int tree[pp+pp];
int hi[100005];
int val[100005];
vector<int> v;
int dp[2][20];
int jr[131072];
int main(){
int n, m;
scanf("%d%d", &n, &m);
for(int i=1;i<pp+pp;i++){
tree[i] = -1;
}
jr[0] = 0;
for(int i=1;i<pp;i++){
jr[i] = jr[i/2] + 1;
}
for(int i=pp;i<pp+n;i++){
scanf("%d", &tree[i]);
hi[tree[i]] = i-pp;
}
for(int i=0;i<n;i++) val[i] = 0;
for(int i=pp-1;i>=1;i--){
tree[i] = min(tree[i*2], tree[i*2+1]);
if(tree[i] > 0) val[hi[tree[i]]]++;
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |