-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path1621.cpp
More file actions
144 lines (123 loc) · 2.96 KB
/
Copy path1621.cpp
File metadata and controls
144 lines (123 loc) · 2.96 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
132
133
134
135
136
137
138
139
140
141
142
143
144
// Date: Thu Aug 1 14:51:25 2024
#include <cassert>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> VI;
typedef pair<int, int> PII;
typedef pair<ll, ll> PLL;
template <class T> using pq = priority_queue<T>;
template <class T> using pqg = priority_queue<T, vector<T>, greater<T>>;
const int INF = 0x3f3f3f3f, MOD = 1e9 + 7, MOD1 = 998244353;
const ll INFL = 0x3f3f3f3f3f3f3f3f;
const double eps = 1e-8;
const int dir[8][2] = {
{0, 1}, {0, -1}, {1, 0}, {-1, 0}, {1, 1}, {1, -1}, {-1, 1}, {-1, -1},
};
const ull Pr = 131;
#define For(i, a, b) for (int i = int(a); i < int(b); ++i)
#define Rof(i, a, b) for (int i = int(b) - 1; i >= int(a); --i)
#define For1(i, a, b) for (int i = int(a); i <= int(b); ++i)
#define Rof1(i, a, b) for (int i = int(b); i >= int(a); --i)
#define ForE(i, j) for (int i = h[j]; i != -1; i = ne[i])
#define f1 first
#define f2 second
#define pb push_back
#define has(a, x) (a.find(x) != a.end())
#define nemp(a) (!a.empty())
#define all(a) (a).begin(), (a).end()
#define all1(a, len) (a + 1), (a + 1 + len)
#define SZ(a) int((a).size())
#define NL cout << '\n';
template <class T> bool ckmin(T &a, const T &b) { return b < a ? a = b, 1 : 0; }
template <class T> bool ckmax(T &a, const T &b) { return a < b ? a = b, 1 : 0; }
template <typename t> istream &operator>>(istream &in, vector<t> &vec) {
for (t &x : vec)
in >> x;
return in;
}
template <typename t> ostream &operator<<(ostream &out, vector<t> &vec) {
int n = SZ(vec);
For(i, 0, n) {
out << vec[i];
if (i < n - 1)
out << ' ';
}
return out;
}
template <typename ForwardIterator>
void Inputr(ForwardIterator begin, ForwardIterator end) {
ForwardIterator it = begin;
while (it != end) {
cin >> *it;
it++;
}
}
template <typename ForwardIterator>
void Outputr(ForwardIterator begin, ForwardIterator end) {
ForwardIterator it = begin;
while (it != end) {
if (it != begin)
cout << ' ';
cout << *it;
it++;
}
NL;
}
template <typename T, typename ForwardIterator>
void Outputr1(ForwardIterator begin, ForwardIterator end) {
copy(begin, end, ostream_iterator<T>(cout, " "));
NL;
}
#ifdef _DEBUG
#include "debug.h"
#else
#define dbg(x...)
#define dbgi(x)
#define dbgln()
#define dbgr(x...)
#endif
const int N = 200100;
int n;
void solve() {
set<int> s;
cin >> n;
For(i, 0, n) {
int x;
cin >> x;
s.insert(x);
}
cout << SZ(s) << '\n';
}
int main(void) {
#ifdef _DEBUG
freopen("1621.in", "r", stdin);
#endif
std::ios::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int T = 1;
while (T--) {
solve();
}
return 0;
}