Advertisement
Guest User

Untitled

a guest
Mar 27th, 2015
216
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. int main(){
  4. int n,x,aux,count=0,div = 0; cin >> n;
  5. for(int i = 0; i < n; i++){
  6. cin >> x; int v[x]; count = 0;
  7. for(int j = 0; j < x; j++){
  8. cin >> aux;
  9. for(int k = 0; k < x; k++){
  10. /* if(k != j){
  11. cout << aux << " = " << v[k] << " ?"<< endl;
  12. }*/
  13. if(aux == v[k] && k != j){
  14. break;
  15. }
  16. else{
  17. v[j] = aux;
  18. count++;
  19. }
  20. }
  21.  
  22. }
  23. cout << count / x<< endl;
  24. }
  25. return 0;
  26. } //n*x² = 10² * 10^4 = 10^6
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement