commit a0d2b24bbf50867a8c8946217dcfb8250fb16128 parent 8eb46cf7f99e863c040332cfa0a53585a9da59ab Author: superpozycja <anna@superpozycja.net> Date: Sun, 27 Oct 2024 14:27:56 +0100 solve distinct numbers Diffstat:
A | sorting_and_searching/distinct_numbers.cpp | | | 34 | ++++++++++++++++++++++++++++++++++ |
1 file changed, 34 insertions(+), 0 deletions(-)
diff --git a/sorting_and_searching/distinct_numbers.cpp b/sorting_and_searching/distinct_numbers.cpp @@ -0,0 +1,34 @@ +#include <bits/stdc++.h> + +using namespace std; + +using ui = unsigned int; +using l = long; +using ul = unsigned long; +using ll = long long; +using ull = unsigned long long; + +using vi = vector<int>; +using vui = vector<ui>; +using vl = vector<l>; +using vul = vector<ul>; +using vll = vector<ll>; +using vull = vector<ull>; + +void solve() +{ + int n; + set<int> s; + cin >> n; + while (n--) { + int tmp; + cin >> tmp; + s.insert(tmp); + } + cout << s.size() << "\n"; +} + +int main() +{ + solve(); +}