-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcpp11main.cpp
More file actions
113 lines (79 loc) · 3.57 KB
/
cpp11main.cpp
File metadata and controls
113 lines (79 loc) · 3.57 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
// Igorjan94, template version from 19 March 2015 (#define -> typedef, readln(vector) patched, version from 27 March 2017)
#include <bits/stdc++.h>
using namespace std;
#define FOR(i, m, n) for (int i = m; i < (int) (n); ++i)
#define ROF(i, m, n) for (int i = m; i >= (int) (n); --i)
#define forn(i, n) for (int i = 0; i < (int) (n); ++i)
#define fori1(n) for (int i = 1; i < (int) (n); ++i)
#define forj1(n) for (int j = 1; j < (int) (n); ++j)
#define fori(n) for (int i = 0; i < (int) (n); ++i)
#define forj(n) for (int j = 0; j < (int) (n); ++j)
typedef vector<long long> vll;
typedef pair<int, int> pii;
typedef valarray<int> va;
typedef vector<int> vi;
typedef long long ll;
#define pb push_back
#define whole(a) a.begin(), a.end()
#define next next__
#define prev prev__
#define count count__
#define argmax(a) (max_element(whole(a)) - (a).begin())
#define argmin(a) (min_element(whole(a)) - (a).begin())
#define ints(a...) int a; readln(a)
#define lls(a...) ll a; readln(a)
#define wr(args...) err(split(#args,',').begin(),args)
#define FILENAME "input"
#define INF 1000000007
#define tthti template<typename Head, typename... Tail> inline
#define ttt12i template<typename T1, typename T2> inline
#define ttti template<typename T> inline
inline void writeln2(){cout<<"\n";}
inline void writeln() {cout<<"\n";}
inline void readln() {}
ttti void read(T&);
ttti void priws(T);
ttti void print(T);
void err(vector<string>::iterator it){++it;}
tthti void readln (Head& head,Tail&... tail){read(head); readln (tail...);}
tthti void writeln2(Head head, Tail... tail){print(head);writeln2(tail...);}
tthti void writeln (Head head, Tail... tail){priws(head);writeln2(tail...);}
ttti void writeln_range(T f,T s){if(f!=s)for(auto i=f;i!=s;++i)writeln(*i);}
tthti void err(vector<string>::iterator it,Head head,Tail...tail){writeln((*it).substr((*it)[0]==' '),"=",head);err(++it, tail...);}
vector<string>split(const string&s,char c){vector<string>v;stringstream ss(s);string x;while(getline(ss,x,c))v.pb(x);return v;}
///-------------------------------------------------------------------------------------------------------------------------------------
//Igorjan
void run()
{
ints(n);
va a(n);
readln(a);
sort(begin(a), end(a));
writeln(a);
}
int main()
{
#ifndef ONLINE_JUDGE
double time = clock();
#endif
ios_base::sync_with_stdio(false);
// freopen(FILENAME".in", "r", stdin);
// freopen(FILENAME".out", "w", stdout);
run();
#ifndef ONLINE_JUDGE
writeln("execution time =", (clock() - time) / CLOCKS_PER_SEC);
#endif
return 0;
}
#define a _a
#define n _n
ttti ostream&operator<<(ostream&os,vector<T>&a);
ttt12i istream&operator>>(istream&is,pair<T1,T2>&a){return is>>a.first>>a.second;}
ttt12i ostream&operator<<(ostream&os,pair<T1,T2>&a){return os<<a.first<<" "<<a.second;}
ttti ostream&operator<<(ostream&os,vector<T>&a){if(a.size())os<<a[0];else os<<"\n";for(int i=1;i<a.size();++i)os<<"\n "[is_fundamental<T>::value]<<a[i];return os;}
ttti istream&operator>>(istream&is,vector<T>&a){for(int i=0;i<a.size();++i)is>>a[i];return is;}
ttti ostream&operator<<(ostream&os,valarray<T>&a){if(a.size())os<<a[0];else os<<"\n";for(int i=1;i<a.size();++i)os<<"\n "[is_fundamental<T>::value]<<a[i];return os;}
ttti istream&operator>>(istream&is,valarray<T>&a){for(int i=0;i<a.size();++i)is>>a[i];return is;}
ttti void print(T a){cout<<" "<<a;}
ttti void priws(T a){cout<<a;}
ttti void read(T& a){cin>>a;}