Submission #1124924

#TimeUsernameProblemLanguageResultExecution timeMemory
1124924hijackedsoulStone Arranging 2 (JOI23_ho_t1)C++17
100 / 100
135 ms12952 KiB
#include <bits/stdc++.h> using namespace std; #define int long long int32_t main(){ int n; std::cin >> n; unordered_map<int, int> mp; std::vector <int> arr(n+1); for(int i=1; i<=n; i++){ std::cin >> arr[i]; mp[arr[i]]=i; } for(int i=1; i<=n; i++){ int j=mp[arr[i]]; for(int z=0; z<=j-i; z++){ std::cout << arr[i] <<"\n"; } i=j; } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...