Submission #919278

#TimeUsernameProblemLanguageResultExecution timeMemory
919278Nobody2604Stone Arranging 2 (JOI23_ho_t1)C++14
25 / 100
2025 ms1368 KiB
#include<iostream> //TO BE OPTIMIZED -> too much time (3 for loops); using namespace std; int main(){ long long n; cin >> n; int arr[n]; //int col = -1; //current color for(int i=0;i<n;i++){ cin >> arr[i]; } for(int i=0;i<n;i++){ for(int j=i;j<n;j++){ if(arr[i] == arr[j]){ for(int l=i;l<j;l++){ arr[l] = arr[i]; } } } } for(int i=0;i<n;i++){ cout << arr[i] << "\n"; } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...