2019南昌ICPC网络赛部分题解 A Subsequence M Subsequence H. Coloring Game K. MORE XOR I Max answer

2019年icpc徐州网络赛部分题题解 A 题 给了n个 线性同余方程组能求出敌人的数量n, 然后就是一个斐波那契博弈。第一个人可以杀死任意多个敌人但是不能全杀,下一个人可以杀死的敌人数量在1到 上一个人杀敌数的2倍 之间。 贴个板子求出n,然后判断了一下是不是斐波那契数就解决了。1A 代码:https://paste.ubuntu.com/p/TD6MFhkkf7/ B题 题意:首先输入一个n, 有n个数字 ... 阅读详情

A Subsequence 

题意:求前五个完美数。

思路:完全数:又称完美数,完备数。所有除了自身以外的约数的和,恰好等于它本身。目前共发现48个完美数。(好像说完美数一定是以6或者8结尾。)

前9个完美数分别为:6、28、496、8128、33550336、8589869056、137438691328、2305843008139952128、2658455991569831744654692615953842176。

欧拉曾推出完美数的公式:如果p是质数,且2^p-1也是质数,那么(2^p-1)*2^(p-1)便是一个完全数。

利用上述性质即可打印出前几个完美数,然后大表即可。

打表代码:(至于为什么而打印出来的完美数一定是前几个......我也不知道)

 

#include<iostream>
#include<iomanip>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<cstring>
#include<string>
#include<queue>
#include<stack>
#include<vector>
#include<map>
#include<set>
#include<sstream>
#include<cstdlib>
#include<time.h>
#define rep(i,a,n) for(int i=a;i<=n;i++)
#define repp(i,n,a) for(int i=n;i>=a;i--)
#define ll long long
#define ull unsigned long long
#define mem(a,x) memset((a),(x),sizeof ((a)))//x只能是0或-1或false或true
#define debug(x) cout<<"X: "<<(x)<<endl
#define de cout<<"************"<<endl
#define lowbit(x) ((x)&(-x))
#define lson rt<<1
#define rson rt<<1|1
#define gcd(a,b) __gcd(a,b)
#define lcm(a,b) a*b/(__gcd(a,b))
#define inf 0x3f3f3f3f//1e9+6e7
#define Eps 1e-8
#define Mod 1e9+7
#define maxn 100010
const double pi=acos(-1.0);
using namespace std;
const int N=10000010;
bool prime[N];
void init()
{
    mem(prime,true);
    prime[0]=false;
    prime[1]=false;
    rep(i,1,N-1)
    {
        if(prime[i])
            for(int j=2;i*j<N-1;j++)
                prime[i*j]=false;
    }
}
ll pow_mod(int a,int b)
{
    ll ret=1;
    while(b)
    {
        if(b&1)
            ret*=a;
        a=a*a;
        b/=2;
    }
    return ret;
}
int main()
{
    init();
    rep(i,2,N-1)
    {
        if(prime[i]&&prime[pow_mod(2,i)-1])
            cout<<(pow_mod(2,i)-1)*pow_mod(2,i-1)<<endl;
    }
    return 0;
}

 AC code:

#include<iostream>
#include<iomanip>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<cstring>
#include<string>
#include<queue>
#include<stack>
#include<vector>
#include<map>
#include<set>
#include<sstream>
#include<cstdlib>
#include<time.h>
#define rep(i,a,n) for(int i=a;i<=n;i++)
#define repp(i,n,a) for(int i=n;i>=a;i--)
#define ll long long
#define ull unsigned long long
#define mem(a,x) memset((a),(x),sizeof ((a)))//x只能是0或-1或false或true
#define debug(x) cout<<"X: "<<(x)<<endl
#define de cout<<"************"<<endl
#define lowbit(x) ((x)&(-x))
#define lson rt<<1
#define rson rt<<1|1
#define gcd(a,b) __gcd(a,b)
#define lcm(a,b) a*b/(__gcd(a,b))
#define inf 0x3f3f3f3f//1e9+6e7
#define Eps 1e-8
#define Mod 1e9+7
#define maxn 100010
const double pi=acos(-1.0);
using namespace std;

int main()
{
    cout<<"6"<<endl;
    cout<<"28"<<endl;
    cout<<"496"<<endl;
    cout<<"8128"<<endl;
    cout<<"33550336"<<endl;
    return 0;
}

M Subsequence

题意:给一个主串S,询问n次,每次给出一个串Ti,问Ti是否为S的子序列。

用 nxt [i] [j] 记录位置 i 后 j 第一次出现的位置。查询直接往后跳即可。

#include<iostream>
#include<iomanip>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<cstring>
#include<string>
#include<queue>
#include<stack>
#include<vector>
#include<map>
#include<set>
#include<sstream>
#include<cstdlib>
#include<time.h>
#define rep(i,a,n) for(int i=a;i<=n;i++)
#define repp(i,n,a) for(int i=n;i>=a;i--)
#define ll long long
#define ull unsigned long long
#define mem(a,x) memset((a),(x),sizeof ((a)))//x只能是0或-1或false或true
#define debug(x) cout<<"X: "<<(x)<<endl
#define de cout<<"************"<<endl
#define lowbit(x) ((x)&(-x))
#define lson rt<<1
#define rson rt<<1|1
#define gcd(a,b) __gcd(a,b)
#define lcm(a,b) a*b/(__gcd(a,b))
#define inf 0x3f3f3f3f//1e9+6e7
#define Eps 1e-8
#define Mod 1e9+7
#define maxn 100010
const double pi=acos(-1.0);
using namespace std;
char s[100010];
char t[1010];
int nex[100010][30];
void getnext()
{
    rep(i,0,100009)
        rep(j,0,29)
            nex[i][j]=-1;
    int len=strlen(s+1);
    repp(i,len,1)
    {
        int a=s[i]-'a'+1;
        rep(j,1,26)
        {
            if(j==a)
                nex[i-1][j]=i;
            else
                nex[i-1][j]=nex[i][j];
        }
    }
    rep(i,1,26)
    {
        if(s[1]-'a'+1==i)
            nex[0][i]=1;
        else
            nex[0][i]=nex[1][i];
    }
}
int main()
{
    scanf("%s",s+1);
    getnext();
    int n;
    cin>>n;
    while(n--)
    {
        scanf("%s",t+1);
        int tlen=strlen(t+1);
        int p=0;
        int f=0;
        rep(i,1,tlen)
        {
            p=nex[p][t[i]-'a'+1];
            if(p==-1)
                {f++;break;}
        }
        if(f==0)
            cout<<"YES"<<endl;
        else
            cout<<"NO"<<endl;
    }
    return 0;
}

H. Coloring Game 

思维,推公式,左下角那个格有两种情况,右上角那个格有两种情况,左上角和右下角只有一种情况,其他的格有三种情况,所以答案就是 2*2*(3^(n-2))%mod ,快速幂一下就行了。当n等1的时候需要特判一下。

#include<iostream>
#include<iomanip>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<cstring>
#include<string>
#include<queue>
#include<stack>
#include<vector>
#include<map>
#include<set>
#include<sstream>
#include<cstdlib>
#include<time.h>
#define rep(i,a,n) for(int i=a;i<=n;i++)
#define repp(i,n,a) for(int i=n;i>=a;i--)
#define ll long long
#define ull unsigned long long
#define mem(a,x) memset((a),(x),sizeof ((a)))//x只能是0或-1或false或true
#define debug(x) cout<<"X: "<<(x)<<endl
#define de cout<<"************"<<endl
#define lowbit(x) ((x)&(-x))
#define lson rt<<1
#define rson rt<<1|1
#define gcd(a,b) __gcd(a,b)
#define lcm(a,b) a*b/(__gcd(a,b))
#define inf 0x3f3f3f3f//1e9+6e7
#define Eps 1e-8
#define Mod 1000000007
#define maxn 100010
const double pi=acos(-1.0);
using namespace std;
ll pow_mod(ll a,ll b,ll mod)
{
    ll ret=1;
    while(b)
    {
        if(b&1)
            {ret=(ret*a)%mod;b--;}
        a=(a*a)%mod;
        b>>=1;
    }
    return ret;
}
int main()
{
    ll n;
    cin>>n;
    if(n==1)
        {cout<<"1";return 0;}
    cout<<4*pow_mod(3,n-2,Mod)%Mod<<endl;
    return 0;
}

K. MORE XOR 

通过打表能推出公式, r 和 l 的差值每个4个一循环。

这题用cout竟然会超时,改成printf就过了,真的是......以后干脆都不用cin cout了,都改成scanf printf算了......

打表代码:

#include<iostream>
#include<iomanip>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<cstring>
#include<string>
#include<queue>
#include<stack>
#include<vector>
#include<map>
#include<set>
#include<sstream>
#include<cstdlib>
#include<time.h>
#define rep(i,a,n) for(int i=a;i<=n;i++)
#define repp(i,n,a) for(int i=n;i>=a;i--)
#define ll long long
#define ull unsigned long long
#define mem(a,x) memset((a),(x),sizeof ((a)))//x只能是0或-1或false或true
#define debug(x) cout<<"X: "<<(x)<<endl
#define de cout<<"************"<<endl
#define lowbit(x) ((x)&(-x))
#define lson rt<<1
#define rson rt<<1|1
#define gcd(a,b) __gcd(a,b)
#define lcm(a,b) a*b/(__gcd(a,b))
#define inf 0x3f3f3f3f//1e9+6e7
#define Eps 1e-8
#define Mod 1e9+7
#define maxn 100010
const double pi=acos(-1.0);
using namespace std;
int a[1010];
int f[110][110],g[110][110],w[110][110];
void ff(int x,int y)
{
    rep(i,x,y)
        {a[i]++;}//a[j]++;}
}
void gg(int x,int y)
{
    rep(i,x,y)
        rep(j,i,y)
            ff(i,j);
}
int main()
{
    int n;
    cin>>n;
    rep(i,1,n)
        a[i]=i;
    int q;
    cin>>q;
    int l,r;
    while(q--)
    {
        scanf("%d%d",&l,&r);
        mem(a,0);
        rep(i,l,r)
            rep(j,i,r)
            {
                gg(i,j);
            }
        rep(i,l,r)
            if(a[i]%2==1)
                cout<<"##"<<i<<endl;
        cout<<endl;
    }
    return 0;
}
/*
100
1000
1 1
1 2
1 3
1 4
1 5
1 6
1 7
1 8
1 9
1 10
1 11
1 12
1 13
1 14
1 15
1 16
1 17
1 18
1 19
1 20


2 2
2 3
2 4
2 5
2 6
2 7
2 8
2 9
2 10
2 11
2 12
2 13
2 14
2 15
2 16
2 17
2 18
2 19
2 20

*/

AC code:

#include<iostream>
#include<iomanip>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<cstring>
#include<string>
#include<queue>
#include<stack>
#include<vector>
#include<map>
#include<set>
#include<sstream>
#include<cstdlib>
#include<time.h>
#define rep(i,a,n) for(int i=a;i<=n;i++)
#define repp(i,n,a) for(int i=n;i>=a;i--)
#define ll long long
#define ull unsigned long long
#define mem(a,x) memset((a),(x),sizeof ((a)))//x只能是0或-1或false或true
#define debug(x) cout<<"X: "<<(x)<<endl
#define de cout<<"************"<<endl
#define lowbit(x) ((x)&(-x))
#define lson rt<<1
#define rson rt<<1|1
#define gcd(a,b) __gcd(a,b)
#define lcm(a,b) a*b/(__gcd(a,b))
#define inf 0x3f3f3f3f//1e9+6e7
#define Eps 1e-8
#define Mod 1e9+7
#define maxn 100010
const double pi=acos(-1.0);
using namespace std;
int a[100010];
int b[100010];
int main()
{
    int T;
    cin>>T;
    while(T--)
    {
        mem(a,0);
        mem(b,0);
        int n;
        scanf("%d",&n);
        rep(i,1,n)
            scanf("%d",&a[i]);
        b[1]=a[1];
        b[2]=a[2];
        b[3]=a[3];
        b[4]=a[4];
        rep(i,5,n)
            b[i]=b[i-4]^a[i];
        int q,l,r;
        scanf("%d",&q);
        while(q--)
        {
            scanf("%d%d",&l,&r);
            if((r-l+1)%4==0)
            {
                printf("0\n");
                continue;
            }
                //{cout<<"0"<<endl;continue;}
            if((r-l+1)%4==1)
            {
                if(l>4)
                    printf("%d\n",(b[l+(r-l)/4*4]^b[l-4]));
                    //cout<<(b[l+(r-l)/4*4]^b[l-4])<<endl;
                else
                    printf("%d\n",b[l+(r-l)/4*4]);
                    //cout<<b[l+(r-l)/4*4]<<endl;
                continue;
            }
            if((r-l+1)%4==2)
            {
                int ans=0;
                if(l>4)
                    ans^=b[l+(r-l)/4*4]^b[l-4];
                else
                    ans^=b[l+(r-l)/4*4];
                l++;
                if(l>4)
                    ans^=b[l+(r-l)/4*4]^b[l-4];
                else
                    ans^=b[l+(r-l)/4*4];
                printf("%d\n",ans);
                //cout<<ans<<endl;
                continue;
            }
            if((r-l+1)%4==3)
            {
                l++;
                if(l>4)
                    printf("%d\n",(b[l+(r-l)/4*4]^b[l-4]));
                    //cout<<(b[l+(r-l)/4*4]^b[l-4])<<endl;
                else
                    printf("%d\n",b[l+(r-l)/4*4]);
                    //cout<<b[l+(r-l)/4*4]<<endl;
                continue;
            }
        }
    }
    return 0;
}

I Max answer

题意:求 “ 区间最小值 * 区间和 ” 的最大值。

思路:二分 + ST表求区间最值 + 线段树求区间最大子段和

用dp[i] 表示以 a [i] 为最小值的所有区间中答案最大的值,那么把dp数组求出来了,只需要枚举一遍找最大值就行了。

当 a[i] 为正数的时候,只需要让这个区间的区间和尽可能的大;当 a[i] 为负数的时候,只需要让这个区间的区间和尽可能的小;

求指定区间的最大子段和和最小子段和,我们可以用线段树来做。

那么怎样求以 a[i] 为最小值的最长区间呢(因为区间越长,那么区间的最大子段和才会越大,最小子段和才会越小)?我们可以二分,用ST表O(1)查询区间最值,然后进行二分。

下面的代码中二分写的有点乱,也是自己写了几组样例然后改来改去......

AC code:

#include<iostream>
#include<iomanip>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<cstring>
#include<string>
#include<queue>
#include<stack>
#include<vector>
#include<map>
#include<set>
#include<sstream>
#include<cstdlib>
#include<time.h>
#define rep(i,a,n) for(int i=a;i<=n;i++)
#define repp(i,n,a) for(int i=n;i>=a;i--)
#define ll long long
#define ull unsigned long long
#define mem(a,x) memset((a),(x),sizeof ((a)))//x只能是0或-1或false或true
#define debug(x) cout<<"X: "<<(x)<<endl
#define de cout<<"************"<<endl
#define lowbit(x) ((x)&(-x))
#define lson rt<<1
#define rson rt<<1|1
#define gcd(a,b) __gcd(a,b)
#define lcm(a,b) a*b/(__gcd(a,b))
#define inf 0x3f3f3f3f//1e9+6e7
#define Eps 1e-8
#define Mod 1e9+7
#define maxn 100010
const double pi=acos(-1.0);
using namespace std;
const int SIZE=500010;
#define l(x) tree[x].l
#define r(x) tree[x].r
#define sum(x) tree[x].sum
#define add(x) tree[x].add

struct node{
    ll l,r;
    ll sum,lmax,rmax,dat;
    ll lmin,rmin,datt;
}t[SIZE*4];
ll a[SIZE],n,m;
ll ff[SIZE][20];
ll x;
void build(ll p,ll l,ll r)
{
    t[p].l=l;
    t[p].r=r;
    if(l==r)
    {
        scanf("%lld",&x);
        a[l]=x;
        t[p].dat=t[p].lmax=t[p].rmax=t[p].sum=x;
        t[p].datt=t[p].lmin=t[p].rmin=t[p].sum=x;
        return ;
    }
    ll mid=(l+r)/2;
    build(p*2,l,mid);
    build(p*2+1,mid+1,r);
    t[p].sum=t[p*2].sum+t[p*2+1].sum;
    t[p].lmax=max(t[p*2].lmax,t[p*2].sum+t[p*2+1].lmax);
    t[p].rmax=max(t[p*2+1].rmax,t[p*2+1].sum+t[p*2].rmax);
    t[p].dat=max(max(t[p*2].dat,t[p*2+1].dat),t[p*2].rmax+t[p*2+1].lmax);

    t[p].lmin=min(t[p*2].lmin,t[p*2].sum+t[p*2+1].lmin);
    t[p].rmin=min(t[p*2+1].rmin,t[p*2+1].sum+t[p*2].rmin);
    t[p].datt=min(min(t[p*2].datt,t[p*2+1].datt),t[p*2].rmin+t[p*2+1].lmin);
}

void change(ll p,ll x,ll y)
{
    if(t[p].l==x&&t[p].r==x)
    {
        t[p].dat=t[p].lmax=t[p].rmax=t[p].sum=y;
        return ;
    }
    ll mid=(t[p].l+t[p].r)/2;
    if(mid<x) change(p*2+1,x,y);
    else  change(p*2,x,y);
    t[p].sum=t[p*2].sum+t[p*2+1].sum;
    t[p].lmax=max(t[p*2].lmax,t[p*2].sum+t[p*2+1].lmax);
    t[p].rmax=max(t[p*2+1].rmax,t[p*2+1].sum+t[p*2].rmax);
    t[p].dat=max(max(t[p*2].dat,t[p*2+1].dat),t[p*2].rmax+t[p*2+1].lmax);
}
node ask(ll p,ll l,ll r){//[l,r]询问的区间    ask(1,x,y)
    if(t[p].l>=l&&t[p].r<=r){
        return t[p];
    }
    ll mid=(t[p].l+t[p].r)>>1;
    if(mid<l)return ask(p<<1|1,l,r);
    else if(mid>=r)return ask(p<<1,l,r);
    else
    {
        node a,b;
        a=ask(p<<1,l,r);
        b=ask(p<<1|1,l,r);
        node tt;
        tt.dat=max(max(a.dat,b.dat),a.rmax+b.lmax);
        tt.lmax=max(a.lmax,a.sum+b.lmax);
        tt.rmax=max(b.rmax,a.rmax+b.sum);

        tt.datt=min(min(a.datt,b.datt),a.rmin+b.lmin);
        tt.lmin=min(a.lmin,a.sum+b.lmin);
        tt.rmin=min(b.rmin,a.rmin+b.sum);

        tt.sum=a.sum+b.sum;
        return tt;
    }
}

void ST_prework()   //ST表O(n* log n)预处理
{
    for(ll i=1;i<=n;i++)
        ff[i][0]=a[i];
    ll t=log(n)/log(2)+1;
    for(ll j=1;j<t;j++)
        for(ll i=1;i<=n-(1<<j)+1;i++)
            ff[i][j]=min(ff[i][j-1],ff[i+(1<<(j-1))][j-1]);
}
ll ST_query(ll l,ll r)  
{
    ll k=log(r-l+1)/log(2);
    return min(ff[l][k],ff[r-(1<<k)+1][k]);
}

ll findp1(ll x) 
{
    if(x==1)
        return 1;
    ll l=1,r=max((ll)1,x-1);
    while(l<=r)
    {
        ll mid=(l+r)>>1;
        if(ST_query(mid,r)<a[x])
            l=mid+1;
        else
            r=mid-1;
    }
    if(ST_query(r,x-1)>a[x])
        return max(min(x,r),(ll)1);
    if(ST_query(l,x-1)>a[x])
        return max(min(x,l),(ll)1);
    else
        return max(min(x,l+1),(ll)1);
}
ll findp2(ll x)
{
    if(x==n)
        return n;
    ll l=min(x+1,n),r=n;
    while(l<=r)
    {
        ll mid=(l+r)>>1;
        if(ST_query(l,mid)<a[x])
            r=mid-1;
        else
            l=mid+1;
    }
    if(ST_query(l,x+1)>a[x])
        return min(max(x,l),n);
    if(ST_query(r,x+1)>a[x])
        return min(max(x,r),n);
    else
        return min(max(x,r-1),n);
}
ll dp[500010];
int main()
{
    cin>>n;
    build(1,1,n);
    ST_prework();   //ST表预处理
    rep(i,1,n)
    {
        dp[i]=a[i]*a[i];    //对dp数组初始化
        ll p1=1,p2=n;
        p1=findp1(i);   //寻找以a[i]为最小值的区间的左端点
        p2=findp2(i);   //寻找以a[i]为最小值的区间的右端点
        node q1=ask(1,p1,i);    //线段树计算a[p1]到a[i]中以a[i]为结尾的最大子段和和最小子段和  时间O(log n)
        node q2=ask(1,i,p2);    //线段树计算a[i]到a[p2]中以a[i]为起始的最大子段和和最小子段和  时间O(log n)
        if(a[i]>0)
            dp[i]=max(dp[i],(q1.rmax+q2.lmax-a[i])*a[i]);
        if(a[i]<0)
            dp[i]=max(dp[i],(q1.rmin+q2.lmin-a[i])*a[i]);
    }
    ll ans=-10;
    rep(i,1,n)
        {ans=max(ans,dp[i]);}
    cout<<ans<<endl;
    return 0;
}

 

2019 ICPC南昌邀请赛网络赛部分题解 A. 题目:https://nanti.jisuanke.com/t/38220 题意:求前5个因子和等于它本身的数(不算自身) 线性筛 #include <cstdio> #include <algorithm> #include <cstring> using namespace std; const int N = 4e6 + 100; ... 阅读详情

相关推荐

探索LLM世界:新手小白的学习路线图

通过系统的学习和实践,新手小白也能逐步掌握LLM的核心技术。掌握LLM不仅能提升个人技术水平,还能为职业发展带来广阔的前景。未来,随着技术的不断进步,LLM将在更多领域发挥重要作用,成为推动科技进步的重要力量。学习LLM是一条充满挑战但也充满机遇的道路。只要你坚持不懈、不断学习和实践,就一定能够在LLM领域取得突破。希望本文提供的学习路线图能为你指明方向,助你早日掌握LLM,开启AI学习的新篇章!

m0_62110645的博客 2370

gmoj 7047. 2021.04.07【2021省赛模拟】染色(coloring) 题解

递推好题,重在转化,容易算重。

_Alexander_的博客 320

安防相机宽动态(WDR)技术解析:从原理到实战应用

本文深入解析安防相机宽动态(WDR)技术原理,对比多次曝光与DOL-WDR等实现方式,并区分硬件WDR与数字WDR(DWDR)的本质差异。文章重点阐述了WDR在逆光出入口、夜间道路监控等五大典型场景的实战应用与调参技巧,旨在帮助用户根据实际需求正确选择与配置,确保监控系统在复杂光线下清晰成像。

weixin_29191081的博客 432

2019ICPC-南昌- E. Bob's Problem

2019ICPC-南昌- E. Bob’s Problem 做法:黑边选完,再选白边。没什么好说的。。 #include<bits/stdc++.h> using namespace std; #define int long long const int maxn=1e6+7; struct edge { int u,v,w,id; bool operator &lt...

行走天涯的豆沙包的博客 551

玩转RecyclerView | 实现子视图叠加 | 3D画廊效果 | 高级动效 | Android 3D坐标系介绍

之前写的一篇文章展示了RecyclerView实现的画廊效果,适用于专辑/图片/列表浏览效果。本篇文章阐述如何基于RecyclerView实现如下图所示的3D画廊效果。以下效果的重点在于实现子视图的图层叠加,滑动过程中的3D旋转效果较为简单。(1)无3D旋转效果图片(1)带3D旋转效果图片。

qq_38237224的博客 8169

【智能车Code review】——小S与中S道路判断

基本思想: 找到中线的左拐点和右拐点,并且计算出两点之间的空间距离。通过限制空间距离,分为中S和小S。 注意这种情况:当20行以下的中线斜率比较陡,此时可以通过人为限制设定,将第0行的中线设置为拐点。 if (flag_centre_right_point == 0 && flag_centre_left_point == 1 && parameterB >= 0.5 && centre_left_point[0] >= 33) { .

hanhan的博客 6114

2019 南昌网络赛 H-The Nth Item

题目链接:https://nanti.jisuanke.com/t/41355 分段打表。。 将一个ll整数分成三部分: 123456789123456789:123456 789123 456789 将这三部分的矩阵幂分别预处理出来。 很秀的打表方法。。。。 代码: #include<bits/stdc++.h> using namespace std; ...

ccsu_deer 806

32、社交媒体大数据中的情感分析与网络欺凌检测

本文探讨了社交媒体大数据在情感分析和网络欺凌检测中的应用。情感分析有助于应对自动化带来的社会变化、促进社会包容和推动环境保护。网络欺凌作为一种严重的在线危害,其检测依赖于数据预处理、特征提取与深度学习模型(如CNN、LSTM)进行分类。文章还总结了大数据在欺诈检测、医疗、制造、交通等领域的广泛应用,并分析了数据存储、处理速度、质量和技术工具等方面的挑战,提出了相应的应对策略。未来,随着技术进步,社交媒体大数据将在更多领域发挥关键作用。

cc789的博客 94

2019南昌网络赛 B. Fire-Fighting Hero

B. Fire-Fighting Hero 题目链接:https://nanti.jisuanke.com/t/41349 Problem Description This is an era of team success, but also an era of heroes. Throughout the ages, there have been numerous examples of ...

_Tiramisu的博客 418

SCADA|KingSCADA实现有新报警时声音报警提示

在SCADA项目中有的现场系统比较多,每个调度员可能会一个人盯好多个系统,因此不会一直盯着一个系统,这时候就需要当有新的报警产生时,有报警声音提示,提示调度员查看报警,进行处理。$NewAlarm是一个离散型的变量,是新报警的意思,即当前系统中有新的报警信息产生时,该变量会自动置为1;以上为一最简单的报警提示的实现,实际中可能还会要求语音播报啥啥报警的声音,具体有时间再进行测试。通过创建测试界面,创建一个内存变量,内存变量,配置报警,界面按钮制造报警,测试效果。

做有价值的事,积累有价值的笔记! 1422

博途PLC模糊PID控制(附SCL完整源代码)

操作人员根据对象的当前状态和以往的控制经验,用手动控制的方法给出适当的控制量,对被控对象进行控制。用电脑模拟操作人员手动控制的经验,对被控对象进行控制。用模糊数学的知识模仿人脑的思维方式,对模糊现象进行识别和判决,给出精确的控制量,对被控对象进行控制。与经典控制理论和现代控制理论相比,模糊控制的特点是不需要建立对象的精确模型。根据操作人员手动控制的经验,总结的完整控制规则,在根据系统当前的运行状态,经过模糊推理,模糊判决等运算,求出控制量,实现对被控对象的控制。......

RXXW_Dor的博客 8973

2019亚洲区域赛徐州网络赛 M Longest subsequence 思维

https://nanti.jisuanke.com/t/41395 String is a very useful thing and a subsequence of the same string is equally important. Now you have a string ss with length nn and a string tt with length mm. Find...

xiji333的博客 725

全国区块链职业技能大赛国赛考题前端功能开发

全国区块链职业技能大赛国赛考题区块链应用前端功能开发

本郡主是喵 1340

51nod---Subsequence (子序列)

A sequence of N positive integers (10 &amp;amp;amp;lt; N &amp;amp;amp;lt; 100 000), each of them less than or equal 10000, and a positive integer S (S &amp;amp;amp;lt; 100 000 000) are given. Write a program to find the minimal length o...

JKdd123456的博客 458

ET2012新版免狗免安装绿色软件

ET2012新版免狗免安祖昂绿色软件。,新界面,新视觉,

VB摄像头监控

该VB模块可对摄像头捕获的画面进行录像等,可在创建的窗口进行控制

[约瑟夫环]2019南昌ICPC网络赛 E magic card

https://nanti.jisuanke.com/t/41352 大概就是约瑟夫环的亚子。 比如输入n,M,q 询问从上到下第x张牌的数字是啥 1肯定是第1个拿走的,特判 剩下就是n-1个牌,x就变成第x-1张牌,如果下标从0开始标号,就变成了x-2 假设res=n-1个人中按M+1报数下标为x-2个人是在第几轮死,则res+1就是要的答案,加的这个1是最顶端的牌 自己赛后才磨出...

Mr_Alice的博客 365

Devexpress16.2.6破解工具

Devexpress16.2.6破解工具Devexpress16.2.6破解工具Devexpress16.2.6破解工具Devexpress16.2.6破解工具

2019ACM-ICPC 沈阳站网络赛 部分题解

C. Dawn-K's water 题意:n表示有n种商品,每种商品有无限个,m表示你需要买的商品的总重量不能小于m,问在你买的总重量不小于m的前提下的最小花费是多少?如果在花费为最小花费的情况下有多种购买方案都满足总重量不小于m,那么输出总重量最大的情况。最后输出的是花费a和重量b。 完全背包。因为题目保证b小于等于1e4,n的总和小于等于5e4,所以时间复杂度O(5e8) ACcode:...

flyzer的博客 1266

华为的C语言编程规范.pdf

华为技术有限公司内部技术规范。本规范制定了编写C语言程序的基本原则、规则和建议。从代码的清晰、简洁、可测试、安全、程序效率、可移植各个方面对C语言编程作出了具体指导。

2019 南昌网络赛题解

A、B、E、G、H、IA、B、E、G、H、IA、B、E、G、H、I代码见githubgithubgithub链接:点击这里 比赛时候真的很可惜,差点可以校div2rank1div2 rank1div2rank1的,和第一差了一分钟的罚时(不到) 只做出来五题,EEE只是运气好,数据比较弱。 正解在这里,不过我并没有看懂: B Fire-Fighting Hero 题意 给定无向图 求kkk个点到...

mxYlulu的博客 416

Is Subsequence-面试题

题目内容: 给定字符串s和t,检查字符串s是否是t的子序列 Given a string s and a string t, check if s is subsequence of t. Example:Input:s = “abc”,t = “ahbgdc” output:true 题目分析 对于字符串s中的每个值在字符串t中从左至右一次查找,t中已经查找过的不重复查找 当t...

spring_willow的博客 267

2019牛客暑期多校训练营(第二场)(A(随机游走/概率)、B(杜教BM)、D(k大团)、E(线段树矩阵)、F(团/dfs暴搜)、H(次大01矩阵/悬线法or单调栈))

A.Eddy Walker(随机游走/概率) T组样例,每次有一个下标0到Ni-1的环, 每次可以随机选择向前一步或向后一步,0后一步是Ni-1,Ni-1向前一步是0 从下标为0的点开始随机游走,直到所有下标都被访问过一次之后停止 停止的位置是Mi,则称这组样例对应事件发生 问前i组样例对应事件连续发生的概率,分数mod 1e9+7 思路来源:官方题解 连续发生显然为前i次的概...

小衣同学的博客 715

2019 ICPC 南昌邀请赛网络赛 M题 Subsequence(预处理+二分查找)

参考来源 https://blog.csdn.net/qq_38735931/article/details/89422093 题目 给你一个主字符串,最大长度为1e5 然后你n个字符串进行询问,n至多1e5,每个字符串最长为1e3 问你这个字符串是不是主字符串的子串(不必连续,但要按顺序) 思路 暴力明显超时。 先对主字符串做预处理,对于每一个字母,把改字母的位置存下来。 用一个vecter 的...

Authur_gyc 659

[ICPC 2019 南京网络赛] 比赛题解

持续更新中… A:The beautiful values of the palace 题意: 给你M个点,Q个矩形,每个点都有一个价值,求每个矩形点价值和 题目分析: 首先我们根据N的值和坐标可以O1的得出每个点的价值,这样就转化成了求一个二维矩阵前缀和的问题,由于我们开不了那么大的空间,我们就把第一维X排序,第二维Y扔进树状数组查询前缀和即可,把每个询问拆成四个点询问前缀和矩阵和,然后就可以得...

HT008的Blog 882

2019ICPC南昌网络赛 - E. Magic Master

题意: 首先一号位置上必为 1,剩下的 n - 1 张牌转化为约瑟夫环问题,共有 n - 1 个人,每数 m + 1 个数淘汰一人,共有 q 次询问,每次询问求第 k 个人是第几个被淘汰的。(n, k <= 40000000, m <= 10, q <= 100) 链接: https://nanti.jisuanke.com/t/41352 题解: 首先约瑟夫环有线性 O(n)...

weixin_44059127的博客 249

[计蒜客]2019 ICPC 徐州网络赛 J(树形dp)

传送门:https://nanti.jisuanke.com/t/41392 题意: 从树的根节点开始dfs(1,1),假设当前节点u的子结点有k个,则递归调用dfs(v,d+1)k次,每次的v都随机从u的k个子结点中选取。问成功找到整棵树的深度的概率是多少? 分析: 显然,这是一道树形dp题,只要推出转移方程即可。比赛时没能推出正确的转移方程,后来看了别人的题解就懂了。 转移方程...

qq619337301的博客 312

Random Access Iterator(2019徐州网络赛)(树形DP or 概率DP)

Random Access Iterator 唉!你能一手双向边秒了我?场上SB了,竟然天真的以为出题人给我数据会按照父节点到儿子节点的顺序给我单向边。。。然后WA到mdbrsl 题意:给定一棵以111为根的树(以后存树千万记得存双向边!),然后问从111开始能到达最大深度的概率。细节补充:从某个父节点可以等概率的选择到达某个儿子节点,并且选择次数为儿子数,即在多次移动中只要有一次遍历到最大深度即...

UniverseofHK的博客 233

[CC-MCO16306]Fluffy and Alternating Subsequence

[CC-MCO16306]Fluffy and Alternating Subsequence 题目大意: 给定一个\(1\sim n(n\le3\times10^5)\)的排列\(a\)。 对于一个序列\(b\),如果以下两个条件之一成立,则称\(b_i\)是一个跳跃序列: \(b_{2k}<b_{2k-1}\)对所有的\(2k\le n\)都成立,且\(b_{2k}<b_{2k+...

weixin_34293141的博客 280

M. Subsequence(The Preliminary Contest for ICPC China Nanchang National Invitational 2019)

题目描述: Give a string S and N string Ti​ , determine whether Ti​ is a subsequence of S. If ti is subsequence of S, print YES,else print NO. If there is an array {K1,K2,K3,⋯ ,Km},so that 1≤K1<K2&lt...

昂昂累世士的博客 444
上一篇: ST算法模板题 POJ 3264
下一篇: Codeforces 877 Round #442 (Div. 2) E. Danil and a Part-time Job
flyzer
博客等级 码龄9年 27粉丝 146原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值