Submission #1024769

#TimeUsernameProblemLanguageResultExecution timeMemory
1024769MohamedFaresNebiliStone Arranging 2 (JOI23_ho_t1)C++14
25 / 100
2056 ms1964 KiB
#include <bits/stdc++.h> using namespace std; int N, A[200005]; vector<int> C; int32_t main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); cin >> N; for(int l = 0; l < N; l++) cin >> A[l]; for(int l = 0; l < N; l++) { int i = l - 1; while(i >= 0 && A[i] != A[l]) i--; if(i == -1) continue; for(; i <= l; i++) A[i] = A[l]; } for(int l = 0; l < N; l++) cout << A[l] << "\n"; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...