bitset 巧妙用法 hdu5972

题目链接

bitset用法整理

#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include 
#include 
#define lowbit(x) (x&(-x))
#define inf  0x7fffffff
#define linf 0x7fffffffffffffff
#define mem(x,y) memset(x,y,sizeof(x))
#define fup(i,x,y) for(int i=(x);i<=(y);i++)
#define fdn(i,x,y) for(int i=(x);i>=(y);i--)
#define sp(x) setprecision(x)
#define sd(n) scanf("%d",&n)
#define sdd(n,m) scanf("%d%d",&n,&m)
#define sddd(n,m,k) scanf("%d%d%d",&n,&m,&k)
#define sld(n) scanf("%lld",&n)
#define sldd(n,m) scanf("%lld%lld",&n,&m)
#define slddd(n,m,k) scanf("%lld%lld%lld",&n,&m,&k)
#define sf(n) scanf("%lf",&n)
#define sff(n,m) scanf("%lf%lf",&n,&m)
#define sfff(n,m,k) scanf("%lf%lf%lf",&n,&m,&k)
#define sc(n) scanf("%s",n)
#define pf(x) printf("%d\n",x)
#define pfl(x) printf("%lld\n",x)
#define pff(x) printf("%lf\n",x)
#define N 5000005
#define M 150005
#define pi acos(-1)
//cout.setf(ios::fixed);

//freopen("out.txt","w",stdout);
using namespace std;
typedef long long ll;
typedef double db;
bitset<1005> b[12],ans;
char c[N];
int main()
{
    int n;
    sd(n);
    fup(i,0,n-1)
    {
        int k;
        sd(k);
        fup(j,0,k-1)
        {
            int x;
            sd(x);
            b[x].set(i);
        }
    }
    sc(c);
    int len=strlen(c);
    fup(i,0,len-1)
    {
        ans<<=1;
        ans.set(0);
        ans&=b[c[i]-'0'];
    //    cout<

 

你可能感兴趣的:(bitset,bitset)