-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMyTemplate.cpp
More file actions
131 lines (121 loc) · 2.92 KB
/
MyTemplate.cpp
File metadata and controls
131 lines (121 loc) · 2.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
/*
* Author: Jony Roy
* Date: 22-06-2016
* Contact: jonyroyice@gmail.com
*/
#include <bits/stdc++.h>
#define PI 3.1415926535897932384
#define EulerConstant 0.5772156649015328606
#define CountBit(a) __builtin_popcount(a)
#define pb(x) push_back(x)
#define mp(x,y) make_pair(x,y)
#define ft first
#define sd second
#define deb(x) cerr << #x << " = " << x << endl;
using namespace std;
typedef double ddd;
typedef long long int llint;
typedef unsigned long long int ullint;
typedef long int lint;
typedef unsigned int uint;
typedef unsigned long int ulint;
typedef pair<int,int> pint;
typedef pair<lint,lint> plint;
typedef pair<llint,llint> pllint;
/*The Debugger Template used Here is written by Bidhan Roy*/
template < typename F, typename S >
ostream& operator << ( ostream& os, const pair< F, S > & p )
{
return os << "(" << p.first << ", " << p.second << ")";
}
template < typename T >
ostream &operator << ( ostream & os, const vector< T > &v )
{
os << "{";
typename vector< T > :: const_iterator it;
for( it = v.begin(); it != v.end(); it++ )
{
if( it != v.begin() ) os << ", ";
os << *it;
}
return os << "}";
}
template < typename T >
ostream &operator << ( ostream & os, const set< T > &v )
{
os << "[";
typename set< T > :: const_iterator it;
for ( it = v.begin(); it != v.end(); it++ )
{
if( it != v.begin() ) os << ", ";
os << *it;
}
return os << "]";
}
template < typename F, typename S >
ostream &operator << ( ostream & os, const map< F, S > &v )
{
os << "[";
typename map< F , S >::const_iterator it;
for( it = v.begin(); it != v.end(); it++ )
{
if( it != v.begin() ) os << ", ";
os << it -> first << " = " << it -> second ;
}
return os << "]";
}
/*..........................................................................*/
template<class T> T gcd(T a,T b)
{
if(b == 0)return a;
return gcd(b,a%b);
}
template<class T> T lcm(T a, T b )
{
return (a*b)/gcd(a,b);
}
template<typename T>
T ext_gcd(T a, T b, T& x, T& y)
{
if (b == 0)
{
x = 1, y = 0;
return a;
}
int d = ext_gcd(b, a%b, y, x);
y -= x*(a / b);
return d;
}
//int fx[]={0,-1,0,1};
//int fy[]={-1,0,1,0};
template< class T> T bigMod(T a,T b,T MOD)
{
if(b==0) return 1;
T temp=bigMod(a,b>>1,MOD);
temp=(temp*temp)%MOD;
if(b&1) temp= (a*temp)%MOD;
return temp;
}
template<class T> T power(T b,T a)
{
T ans=1;
if(a==0) return 1;
for(T i=1; i<=a; i++)
{
ans*=b;
}
return ans;
}
int main()
{
ios_base::sync_with_stdio(0); cin.tie(0);
int a[1000],n;
cin>>n;
for(int i=0;i<n;i++)
cin>>a[i];
//__insertion_sort(a,a+n);
__sort(a,a+n);
for(int i=0;i<n;i++)
cout<<a[i]<<" ";
return 0;
}