fork(1) download
  1. #include<bits/stdc++.h>
  2. #define ll long long int
  3. #define vec vector<ll>
  4. #define f(var,a,b) for(ll var = a ; var < b ; var++ )
  5. #define fasthoja ios_base::sync_with_stdio(false); cin.tie(NULL);
  6. using namespace std;
  7.  
  8. int main(void){
  9. fasthoja;
  10. ll t; cin>>t;
  11.  
  12. while(t--){
  13. ll n; cin >> n;
  14. vec v(n); f(i,0,n) cin >> v[i];
  15.  
  16. vec freq(100000,0); // array for storing frequency of elements
  17.  
  18. bool isBeauty = true;
  19.  
  20. f(i,0,n) {
  21. freq[ v[i] ]++;
  22. if( freq[ v[i] ] > 1 ) {
  23. isBeauty = false;
  24. break;
  25. }
  26. }
  27.  
  28. if( isBeauty ) cout << "prekrasnyy\n";
  29. else cout << "ne krasivo\n";
  30. }//end of test case loop
  31.  
  32. return 0;
  33. }
  34.  
Success #stdin #stdout 0s 4404KB
stdin
2
4
1 2 3 4
6
1 2 3 5 1 4
stdout
prekrasnyy
ne krasivo