fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. int main(){
  4. int t;cin>> t;
  5. while (t--){
  6. int n,k;
  7. cin>>n>>k;
  8. int freq[n];
  9. for(int i=0;i<n;i++){
  10. int x;cin>>x;
  11. freq[x]++;
  12. }
  13. int x=0;int y=1;
  14. cout << freq[0];
  15. while (y<=n){
  16. if (freq[x]!=freq[y]){
  17. cout << "Yes" << '\n';
  18. break;
  19. }
  20. else if (freq[x]==freq[y] && y==n){
  21. cout << "No" << '\n';
  22. break;
  23. }
  24. x++;
  25. y++;
  26. }
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37. }
  38. }
Success #stdin #stdout 0s 544KB
stdin
Standard input is empty
stdout
999822992999822992