# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1033214 | vjudge1 | Lottery (CEOI18_lot) | C++17 | 480 ms | 12112 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;
int main(){
int n,leng;
cin>>n>>leng;
int a[n+1];
for(int q=1;q<=n;q++){
cin>>a[q];
}
int q;
cin>>q;
pair<int,int>tny[q+1];
for(int w=1;w<=q;w++){
cin>>tny[w].first;
tny[w].second=w;
}
sort(tny+1,tny+q+1);
int pos[leng+1];
memset(pos,-1,sizeof pos);
for(int w=1;w<=q;w++){
if(pos[tny[w].first]==-1){
pos[tny[w].first]=w;
}
}
for(int w=leng-1;w>=0;w--){
if(pos[w]==-1){
pos[w]=pos[w+1];
# | 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... |