# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
839241 | SalihSahin | Packing Biscuits (IOI20_biscuits) | C++17 | 0 ms | 0 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
#define pb push_back
#define fastio cin.tie(0); ios_base::sync_with_stdio(false);
#define endl "\n"
#define int long long
typedef long long ll;
using namespace std;
const int N = 501;
const int mod = 998244353;
const ll inf = 2e18 + 7;
int32_t main(){
fastio;
int q;
cin>>q;
while(q--){
int k, x;
cin>>k>>x;
vector<int> a(k + 10);
for(int i = 0; i < k; i++){
cin>>a[i];
int cnt = (a[i]-1)/2;
a[i] -= cnt * 2;
a[i+1] += cnt;
}
int s = 0;
for(int i = 0; i <= k; i++){
s += (a[i] > 0);
}
cout<<(1 << s)<<endl;
}
return 0;
}