fork download
  1. #include <stdio.h>
  2. #include <math.h>
  3.  
  4.  
  5. long long a[200005];
  6. void sx(long long s[],int n){
  7. for(int i=1;i<=n;++i){
  8. int d=0;
  9. for(int j=1;j<=n-i;++j){
  10. if(s[j]>s[j+1]){
  11. int temp=s[j];
  12. s[j]=s[j+1];
  13. s[j+1]=temp;
  14.  
  15. }
  16. }
  17. }
  18. }
  19. int main(){
  20. int n;
  21. scanf("%d",&n);
  22. for(int i=1;i<=n;++i)scanf("%lld",&a[i]);
  23. sx(a,n);
  24. int dem=1;
  25. for(int i=1;i<n;++i){
  26. if(a[i]!=a[i+1])dem++;
  27. }
  28. printf("%d",dem);
  29.  
  30. return 0;
  31. }
  32.  
Success #stdin #stdout 0.24s 5300KB
stdin
Standard input is empty
stdout
1