Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- #define Vi vector<int>
- #define Vs vector<string>
- #define Mii map<int,int>
- #define Msi map<string,int>
- #define Mis map<int,string>
- #define Mss map<string,string>
- #define T true
- #define F false
- typedef long long ll;
- using namespace std;
- int main(){
- int n,now,ans=1;
- int score[1000];
- cin>>n;
- for(int i=0;i<n;i++) cin>>score[i];
- sort(score,score+n);
- now=score[0];
- for(int i=0;i<n-1;i++){
- if(now!=score[i+1]) {
- now=score[i+1];
- ans++;
- }
- }
- if(score[0]==0) ans--;
- cout<<ans;
- }
Add Comment
Please, Sign In to add comment