0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-11-23 21:28:48 +00:00

4317. 不同正整数的个数

https://www.acwing.com/problem/content/submission/code_detail/12513087/
This commit is contained in:
Baoshuo Ren 2022-03-26 19:03:53 +08:00
parent 4d508408b1
commit a2eaf2838e
Signed by: baoshuo
GPG Key ID: 70F90A673FB1AB68

20
AcWing/4317/4317.cpp Normal file
View File

@ -0,0 +1,20 @@
#include <iostream>
#include <set>
using std::cin;
using std::cout;
const char endl = '\n';
int n;
std::set<int> set;
int main() {
std::ios::sync_with_stdio(false);
cin >> n;
for (int i = 1, x; i <= n; i++) {
cin >> x;
if (x > 0) set.insert(x);
}
cout << set.size() << endl;
return 0;
}