Submission #999132

#TimeUsernameProblemLanguageResultExecution timeMemory
999132ZeroCoolStone Arranging 2 (JOI23_ho_t1)C++14
100 / 100
143 ms18364 KiB
#include <bits/stdc++.h> using namespace std; #define int long long #define ll long long #define ar array #define ld long double const int N = 2000, MOD = 1e9 + 7, INF = 1e17; signed main(){ios::sync_with_stdio(false);cin.tie(0); int n; cin>>n; int A[n]; map<int,int> lst; for(int i = 0;i<n;i++){ cin>>A[i]; lst[A[i]] = i; } for(int i = 0;i + 1 < n;i++){ if(lst[A[i]] > i){ A[i+1] = A[i]; } } for(int i = 0;i<n;i++)cout<<A[i]<<'\n'; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...