货币系统的bitset写法
#include<bits/stdc++.h>
using namespace std;
#define rep(i,a,b) for(int i=a;i<=b;++i)
#define dwn(i,a,b) for(int i=a;i>=b;--i)
template <typename T> inline void rd(T &x){x=0;char c=getchar();int f=0;while(!isdigit(c)){f|=c=='-';c=getchar();}while(isdigit(c)){x=(x<<1)+(x<<3)+(c^48);c=getchar();}x=f?-x:x;}
#define mem(a,b) memset(a,b,sizeof(a))
const int V=25010,N=110;
int T,n;
int a[N];
bitset<V>v;
int main(){
rd(T);
while(T--){
v.reset();
v[0]=1;
rd(n);
rep(i,1,n)rd(a[i]);
sort(a+1,a+n+1);
int cnt=0;
rep(i,1,n){
if(!v[a[i]]){
cnt++;
for(int w=a[i];w<=a[n];w<<=1)
v|=v<<w;
}
}
printf("%d
", cnt);
}
return 0;
}