# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
839241 | 2023-08-29T10:27:02 Z | SalihSahin | 비스킷 담기 (IOI20_biscuits) | C++17 | 0 ms | 0 KB |
#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; }