pdpd123

Problem 20

Feb 17th, 2020
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.54 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2.  
  3. #define Vi vector<int>
  4. #define Vs vector<string>
  5. #define Mii map<int,int>
  6. #define Msi map<string,int>
  7. #define Mis map<int,string>
  8. #define Mss map<string,string>
  9. #define T true
  10. #define F false
  11.  
  12. typedef long long ll;
  13. using namespace std;
  14. int main(){
  15.     int n,now,ans=1;
  16.     int score[1000];
  17.     cin>>n;
  18.     for(int i=0;i<n;i++) cin>>score[i];
  19.     sort(score,score+n);
  20.     now=score[0];
  21.     for(int i=0;i<n-1;i++){
  22.         if(now!=score[i+1]) {
  23.             now=score[i+1];
  24.             ans++;
  25.            
  26.         }
  27.     }
  28.     if(score[0]==0) ans--;
  29.     cout<<ans;
  30. }
Add Comment
Please, Sign In to add comment