-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path1221A.cpp
More file actions
61 lines (57 loc) · 935 Bytes
/
Copy path1221A.cpp
File metadata and controls
61 lines (57 loc) · 935 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#include <bits/stdc++.h>
using namespace std;
typedef long long int lli;
int main()
{
ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
int t;
cin >> t;
while(t--)
{
int n;
cin >> n;
vector<lli>v(n);
bool b = false,c=false;
vector<int >a(11);
for(int i=0;i<n;i++)
{
cin >> v[i];
if(v[i] == 2048)
b = true;
else if(v[i] == 1)
a[0]++;
else if(v[i] == 2)
a[1]++;
else if(v[i] == 4)
a[2]++;
else if(v[i] == 8)
a[3]++;
else if(v[i] == 16)
a[4]++;
else if(v[i] == 32)
a[5]++;
else if(v[i] == 64)
a[6]++;
else if(v[i] == 128)
a[7]++;
else if(v[i] == 256)
a[8]++;
else if(v[i] == 512)
a[9]++;
else if(v[i] == 1024)
a[10]++;
}
if(b)
cout << "YES" << endl;
else
{
for(int i=1;i<11;i++)
a[i]+=a[i-1]/2;
if(a[10]>=2)
cout << "YES" << endl;
else
cout << "NO" << endl;
}
}
return 0;
}