# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
738797 | tooxpert | Stone Arranging 2 (JOI23_ho_t1) | C++17 | 41 ms | 4008 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.
//runner code :
//cd "c:\Users\410-15\Desktop\" ; if ($?) { g++ cow.cpp -o cow } ; if ($?) { .\cow }
//designed by tooxpert
#include <bits/stdc++.h>
#define ll unsigned long long
#define in insert
#define needforspeed ios_base::sync_with_stdio(false); cin.tie(); cout.tie()
#define pb push_back
#define mp make_pair
#define sil erase
#define em emplace
#define INF 1e9
#define LF 1e10-10
#define MOD 1e9+7
#define MIN -1e9
#define F first
#define S second
#define sort(v) sort(v.begin(), v.end());
using namespace std;
int main(){
needforspeed;
ll n, m, t, i, j;
cin>>n;
vector<ll>v(n), vr(n);
for(i=0; i<n; i++){
cin>>v[i];
vr[v[i]]=i;
}
for(i=0; i<n; i++){
for(j=i; j<=vr[v[i]]; j++) cout<<v[i]<<'\n';
i=vr[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... |