Submission #953944

#TimeUsernameProblemLanguageResultExecution timeMemory
953944vjudge1Stone Arranging 2 (JOI23_ho_t1)C++98
100 / 100
440 ms12880 KiB
#include<bits/stdc++.h> using namespace std; const int MAX_N = 200000; int N; int A[MAX_N]; map<int, int> mpa; int main(){ cin.tie(0); cout.tie(0); ios::sync_with_stdio(false); cin >> N; for(int i = 0; i < N; i++){ cin >> A[i]; mpa[A[i]] = i; } for(int i = 0; i < N; i++){ if(mpa.count(A[i]) == 0){ cout << A[i] << endl; }else{ int num = A[i]; int num2 = mpa[A[i]]; for(; i <= num2; i++){ cout << num << endl; } i--; } } return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...