fork(3) download
  1. #include<iostream>
  2. #include<stdio.h>
  3. #include<algorithm>
  4. using namespace std;
  5. int main()
  6. {
  7. int t;
  8. cin>>t;
  9. int array[t];
  10. //if(t<=10*10*10*10*10*10) NO NEED FOR THIS CONDITION as the inps are designed in such a way that u need not check overflow of constraints!!!!
  11. //{
  12. for(int i=0;i<t;i++)
  13. {
  14. scanf("%d",&array[i]); //cin>>array[i]; to slow will give tle
  15. }
  16. sort(array,array+t);
  17. for(int n=0;n<t;n++)
  18. {
  19. //if(array[n]!=array[n+1]) NO NEED FOR THIS CONDITION! as no such condition exists!!!
  20. printf("%d\n",array[n]);//cout<<array[n]<<endl; cout too slow and print newline after every output!!!
  21. }
  22. //}
  23. return 0;
  24. }
Success #stdin #stdout 0s 2856KB
stdin
5
5
3
6
7
1
stdout
1
3
5
6
7