-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
109 lines (107 loc) · 2.58 KB
/
main.cpp
File metadata and controls
109 lines (107 loc) · 2.58 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
#include <bits/stdc++.h>
#define endl "\n"
#define fi first
#define se second
#define pb push_back
#define gcd __gcd
typedef int64_t i64;
typedef int32_t i32;
using ll = long long;
using ull = unsigned long long;
using LL = long long;
using ULL = unsigned long long;
using std::cout, std::cin, std::cerr, std::vector, std::string, std::pair, std::map, std::set, std::priority_queue, std::queue, std::stack, std::sort, std::unordered_map, std::unordered_set, std::min, std::max, std::sort, std::reverse, std::swap, std::abs, std::ostream, std::to_string, std::lower_bound, std::upper_bound, std::deque;
constexpr int inf = 0x3f3f3f3f;
constexpr long long INF = 0x3f3f3f3f3f3f3f3f;
ll gcd(ll a, ll b)
{
if (b == 0)
return a;
return gcd(b, a % b);
}
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }
void test() { cout << "test" << endl; }
template <typename T>
ostream &operator<<(ostream &os, const vector<T> &v)
{
os << "[";
for (auto it = v.begin(); it != v.end(); ++it)
{
if (it != v.begin())
os << ", ";
os << *it;
}
return os << "]";
}
template <typename T1, typename T2>
ostream &operator<<(ostream &os, const pair<T1, T2> &p) { return os << "(" << p.first << ", " << p.second << ")"; }
#define dbg(...) cerr << "[" << __LINE__ << "] " << #__VA_ARGS__ << " = ", _dbg(__VA_ARGS__), cerr << endl
void _dbg() {}
template <typename T, typename... Args>
void _dbg(T &&arg, Args &&...args)
{
cerr << arg;
if (sizeof...(args) > 0)
cerr << ", ";
_dbg(args...);
}
template <typename T, typename N, typename... Args>
void _dbg(T *arr, N n, Args &&...rest)
{
cerr << "[";
for (N i = 0; i < n; ++i)
{
if (i != 0)
cerr << ", ";
cerr << arr[i];
}
cerr << "]";
if (sizeof...(rest) > 0)
cerr << ", ";
_dbg(rest...);
}
#define int long long
constexpr int N = 1e5 + 10, M = 1e5 + 10;
ll C(int n, int m)
{
if (m > n)
return 0;
ll res = 1;
for (int i = 1; i <= m; i++)
{
res = res * (n - i + 1) / i;
}
return res;
};
inline void solve()
{
int n;
cin >> n;
unordered_set<int> s;
for( int i = 0; i < n; ++i )
{
int x;
cin >> x;
if(!s.contains(x))
{
s.insert(x);
cout << x << " ";
}
}
}
signed main()
{
cin.tie(nullptr)->std::ios::sync_with_stdio(false);
cout.tie(nullptr);
#if ONLINE_JUDGE
char readBuffer[1 << 20];
cin.rdbuf()->pubsetbuf(readBuffer, sizeof(readBuffer));
#endif
int T = 1;
// cin>>T;
while (T--)
{
solve();
}
return 0;
}