mirror of
https://git.sb/baoshuo/OI-codes.git
synced 2024-11-08 15:58:48 +00:00
4317. 不同正整数的个数
https://www.acwing.com/problem/content/submission/code_detail/12513087/
This commit is contained in:
parent
4d508408b1
commit
a2eaf2838e
20
AcWing/4317/4317.cpp
Normal file
20
AcWing/4317/4317.cpp
Normal 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;
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user