• spoj5973


    SP5973 SELTEAM - Selecting Teams

    #include <bits/stdc++.h>
    using namespace std;
    typedef long long ll;
    inline ll read()
    {
        ll s=0; bool f=0; char ch=' ';
        while(!isdigit(ch)) {f|=(ch=='-'); ch=getchar();}
        while(isdigit(ch)) {s=(s<<3)+(s<<1)+(ch^48); ch=getchar();}
        return (f)?(-s):(s);
    }
    #define R(x) x=read()
    inline void write(ll x)
    {
        if(x<0) {putchar('-'); x=-x;}
        if(x<10) {putchar(x+'0'); return;}
        write(x/10); putchar((x%10)+'0');
    }
    #define W(x) write(x),putchar(' ')
    #define Wl(x) write(x),putchar('
    ')
    const int N=100005;
    const ll Mod=8388608;
    ll T,n,k;
    ll C[N][25];
    inline void Ad(ll &x,ll y)
    {
        x+=y; x-=(x>=Mod)?Mod:0;
    }
    int main()
    {
        ll i,j,ans;
        R(T);
        C[0][0]=1;
        for(i=1;i<=100000;i++)
        {
            C[i][0]=1; for(j=1;j<=min(23ll,i);j++) C[i][j]=(C[i-1][j]+C[i-1][j-1])%Mod;
        }
        while(T--)
        {
            R(n); R(k); ans=0;
            for(i=1;i<=min(k,23ll);i++) Ad(ans,C[n][i]*i%Mod*(1ll<<(i-1))%Mod);
            Wl(ans);
        }
        return 0;
    }
    /*
    input
    3
    2 2
    7 1
    5 3
    output
    6
    7
    165
    */
    View Code
  • 相关阅读:
    代码审计之越权及越权
    代码审计之XSS及修复
    代码审计之SQL注入及修复
    代码审计之CSRF原理及修复
    挖穿各大SRC的短信轰炸
    Kerberoasting攻击
    SPN扫描
    Windows认证 | 域认证
    Windows认证 | 网络认证
    Ceph 纠删码介绍
  • 原文地址:https://www.cnblogs.com/gaojunonly1/p/11203399.html
Copyright © 2020-2023  润新知