# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1065169 | ttttttttttttth | Stone Arranging 2 (JOI23_ho_t1) | C++17 | 172 ms | 18448 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 int long long
const int N = 2e5+5;
int n,a[N];
map<int,int> pos;
signed main () {
if (fopen("MARBEL.inp", "r")){
freopen("MARBEL.inp", "r", stdin);
freopen("MARBEL.out", "w", stdout);
}
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
cin >> n ;
for(int i=1;i<=n;i++){
cin >> a[i];
pos[a[i]] = i;
}
for(int i=1;i<=n;){
int x = pos[a[i]];
while(i <= x){
cout << a[x] << " ";
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... |