Solution for List Minimum (Hard) in C++


April 12, 2020 0.091559 seconds C++
#include <bits/stdc++.h>

using namespace std;

template<class C>constexpr int sz(const C&c){return int(c.size());}

  int main(){
      ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
		
		int n, temp = 0;
		cin >> n; 
		int arr[n] = {0};
		
		for(int i = 0; i < n; i++){
			cin >> temp;
			arr[i] = temp;
		}
		
		int b = sizeof(arr)/sizeof(arr[0]);
		sort(arr, arr+b);
		
		for(int i = 0; i < n; i++){
			cout << arr[i] << "\n";
			
		}
		
      
      return 0;
}

Editorial


No editorial for this problem. :(

Original Problem


You can view the original page for this problem on the DMOJ.