#include<bits/stdc++.h>
using namespace std;
#define int long long
int t, ans;
void solve() {
int n, k, x, ans;
scanf("%lld%lld", &n, &k);
ans = 1;
int pre = 1, behind = n;
for (int i = 0; i < k; i++) {
scanf("%lld", &x);
if (x == 1) {
pre += ans;
} else if (x == 2) {
behind -= ans;
}
ans *= 2;
}
printf("%lld\n", pre);
}
signed main() {
scanf("%lld", &t);
while (t--) {
solve();
}
return 0;
}
感谢大家的支持!
(我绝对不会告诉你我用了3个流量券才得到一个题解)