diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2026-07-06 19:08:08 +0200 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2026-07-06 19:08:08 +0200 |
| commit | 96254947699986c59f0dc63d69fd4b76bd3ed43e (patch) | |
| tree | 6c4dca945d7f7427c48be234d827fe4d33be02c5 /02_sorting_and_searching/distinct_numbers_1621.cpp | |
| download | cses-96254947699986c59f0dc63d69fd4b76bd3ed43e.tar.gz cses-96254947699986c59f0dc63d69fd4b76bd3ed43e.zip | |
Initial commit
Diffstat (limited to '02_sorting_and_searching/distinct_numbers_1621.cpp')
| -rw-r--r-- | 02_sorting_and_searching/distinct_numbers_1621.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/02_sorting_and_searching/distinct_numbers_1621.cpp b/02_sorting_and_searching/distinct_numbers_1621.cpp new file mode 100644 index 0000000..9c39aa3 --- /dev/null +++ b/02_sorting_and_searching/distinct_numbers_1621.cpp | |||
| @@ -0,0 +1,13 @@ | |||
| 1 | #include <iostream> | ||
| 2 | #include <set> | ||
| 3 | |||
| 4 | int main() { | ||
| 5 | int n, x; | ||
| 6 | std::set<int> s; | ||
| 7 | std::cin >> n; | ||
| 8 | for (int i = 0; i < n; i++) { | ||
| 9 | std::cin >> x; | ||
| 10 | s.insert(x); | ||
| 11 | } | ||
| 12 | std::cout << s.size() << "\n"; | ||
| 13 | } | ||
