Advertisement
Guest User

Untitled

a guest
Sep 19th, 2019
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.55 KB | None | 0 0
  1.  
  2. #include <bits/stdc++.h>
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8.     ios_base::sync_with_stdio(0);
  9.     //freopen("input.txt","r",stdin);
  10.     //freopen("output.txt","w",stdout);
  11.     int t;
  12.     cin >> t;
  13.     for(int kk = 1; kk <= t; kk++)
  14.     {
  15.         int n;
  16.         cin >> n;
  17.         int sum = 0;
  18.         for(int i = 1; i <= n; i++)
  19.         {
  20.             int x;
  21.             cin >> x;
  22.             if(x <= 2048)
  23.                 sum += x;
  24.         }
  25.         if(sum >= 2048) cout << "YES" << endl;
  26.         else cout << "NO" << endl;
  27.     }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement