# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
740617 | brunnorezendes | Stone Arranging 2 (JOI23_ho_t1) | C++14 | 283 ms | 17424 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,a;
cin>>N;
vector<int> v;
set<pair<int,int>> pos;
vector<pair<int,pair<int,int>>> vf;
for (int i = 0; i<N; i++){
cin>>a;
v.push_back(a);
pos.insert({a,i});
}
for( int i = 0; i < N; i ++){
auto tmp = pos.lower_bound({v[i], N+1});
tmp--;
vf.push_back({v[i],{i,(*tmp).second}});
i = tmp->second;
}
for(int i = 0; i < vf.size(); i++){
for(int j = 0; j <= vf[i].second.second - vf[i].second.first; j++)
cout<<vf[i].first<<"\n";
}
return 0;
}
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... |