Submission #774755

#TimeUsernameProblemLanguageResultExecution timeMemory
774755ngungunguStone Arranging 2 (JOI23_ho_t1)C++17
100 / 100
469 ms16388 KiB
#include<bits/stdc++.h> using namespace std; #define int long long const int maxn = 2e5 + 5; map<int,int> d; signed main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); int n; cin >> n; map<int, int> d; int a[maxn]; for(int i = 1; i <= n; i++) { cin >> a[i]; d[a[i]] = i; } for(int i = 1; i <= n; i++) { for(int j = 1; j <= d[a[i]] - i + 1; j++){ cout << a[i] << endl; } i = d[a[i]]; } return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...