Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <bits/stdc++.h>
- using namespace std;
- int n,temp,zlicz[1000000],ile=0;
- long long t[(int)2e4+1];
- int main()
- {
- cin>>n;
- for(int i=0;i<n;i++){
- cin>>t[i];
- zlicz[t[i]]++;}
- for(int j=n-1;j>0;j--)
- for(int i=0;i<j;i++)
- {
- if(t[i]>t[i+1])
- {
- temp=t[i];
- t[i]=t[i+1];
- t[i+1]=temp;
- }
- }
- for(int i=0;i<(int)2e4+1;i++)
- {
- if(zlicz[i]>0)
- ile++;
- }
- cout<<ile;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement