Submission #1124918

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