fork download
  1. // وَأَن لَّيْسَ لِلْإِنسَانِ إِلَّا مَا سَعَىٰ (39) وَأَنَّ سَعْيَهُ سَوْفَ يُرَىٰ (40)
  2.  
  3. /*
  4.   author: Mazen Mohamed
  5. */
  6. #include <bits/stdc++.h>
  7. #include <ext/pb_ds/assoc_container.hpp>
  8. #include <ext/pb_ds/tree_policy.hpp>
  9.  
  10. using namespace std;
  11. using namespace __gnu_pbds;
  12. using ll = long long;
  13. using ld = long double;
  14.  
  15. #define all(x) x.begin(),x.end()
  16. #define v(x) vector<x>
  17. #define nl '\n'
  18. #define sp ' '
  19. #define fxd(x) fixed << setprecision(x)
  20. template<class t> using ordered_set = tree<t, null_type, less<t>, rb_tree_tag, tree_order_statistics_node_update>;
  21. template<class t> using ordered_multiset = tree<t, null_type, less_equal<t>, rb_tree_tag, tree_order_statistics_node_update>;
  22.  
  23. ll mod = 1e9 + 7;
  24. ld pi = acos(-1);
  25.  
  26. ll dr[8] = {0, 0, 1, -1, 1, 1, -1, -1};
  27. ll dc[8] = {1, -1, 0, 0, 1, -1, 1, -1};
  28.  
  29.  
  30. void hankasha()
  31. {
  32. int n; cin >> n;
  33. ll mn = 1e9;
  34. for (int i = 0; i < n; i++)
  35. {
  36. ll x; cin >> x;
  37. ll cnt = 0;
  38. while (x%2 == 0)
  39. {
  40. x /= 2; cnt++;
  41. }
  42. mn = min(mn,cnt);
  43. }
  44. cout << mn;
  45. }
  46.  
  47.  
  48. int main()
  49. {
  50. ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
  51. #ifndef ONLINE_JUDGE
  52. freopen("input.txt", "r", stdin);
  53. freopen("output.txt", "w", stdout);
  54. #endif
  55.  
  56. int t = 1;
  57.  
  58. while (t--)
  59. {
  60. hankasha();
  61. }
  62. }
Success #stdin #stdout 0s 544KB
stdin
Standard input is empty
stdout
3