Advertisement
sherry_ahmos

Untitled

Dec 17th, 2021
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.76 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. void sherry()
  4. {
  5. #ifndef ONLINE_JUDGE
  6.     freopen("input.txt", "r", stdin), freopen("output.txt", "w", stdout);
  7. #endif
  8. }
  9. int main()
  10. {
  11.     sherry();
  12.     long long n;
  13.     cin >> n;
  14.     long long arr[n];
  15.     for (int i = 0; i < n; i++)
  16.     {
  17.         cin >> arr[i];
  18.     }
  19.     long long min = arr[0];
  20.     int flag = 0;
  21.     for (int s = 0; s < n; s++)
  22.     {
  23.         if (arr[s] <= min)
  24.         {
  25.             min = arr[s];
  26.         }
  27.     }
  28.     cout << min << endl;
  29.     for (int i = 0; i < n; i++)
  30.     {
  31.         if (arr[i] == min)
  32.         {
  33.             flag++;
  34.         }
  35.     }
  36.     if ((min % 2 == 0) || (flag > 1))
  37.     {
  38.         cout << "Unlucky";
  39.     }
  40.     else
  41.     {
  42.         cout << "Lucky";
  43.     }
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement