fork download
  1. #include<iostream>
  2. #include<vector>
  3. #include<deque>
  4. #include<stack>
  5. #include<queue>
  6. #include<set>
  7. #include<map>
  8. using namespace std;
  9. void Mohamed1205()
  10. {
  11. ios_base::sync_with_stdio(false);
  12. cin.tie(nullptr);
  13. cout.tie(nullptr);
  14. }
  15. int const mohamed=1e3+3;
  16. int const Badr=1e5+3;
  17.  
  18. int main() {
  19. Mohamed1205();
  20.  
  21. int t,n;
  22. vector<int>a(mohamed);
  23. int f[Badr]={};
  24. cin>>t;
  25. while (t--)
  26. {
  27. bool beautiful=true;
  28. f[Badr]={};
  29. cin>>n;
  30. for (int i=0;i<n;i++)
  31. {
  32. int x;
  33. cin>>x;
  34. a[i]=x;
  35. f[x]++;
  36. }
  37. for (int i=0;i<n;i++)
  38. {
  39.  
  40. if (f[a[i]]>1)
  41. {
  42. beautiful=false;
  43.  
  44. break;
  45. }
  46. }
  47. if (beautiful)
  48. cout<<"prekrasnyy"<<'\n';
  49. else cout<<"ne krasivo"<<'\n';
  50.  
  51. for (int i = 0; i < n; i++) {
  52. f[a[i]] = 0;}
  53. }
  54.  
  55.  
  56.  
  57. return 0;
  58. }
Success #stdin #stdout 0.01s 5288KB
stdin
Standard input is empty
stdout
Standard output is empty