其他分享
首页 > 其他分享> > CF1477A Nezzar and Board(数论)(代办)

CF1477A Nezzar and Board(数论)(代办)

作者:互联网

CF1477A Nezzar and Board

	void solve()
{
    cin >> n >> m;
    for(int i=1;i<=n;i++){
    	scanf("%lld",&a[i]);
    }
    /// 2x - y
    /// 
    ll d = 0;

    for(int i=1;i<=n;i++){
    	d = __gcd(d,(a[i]-a[1]));
    }
    if((m-a[1])%d==0) puts("YES");
    else puts("NO");
    
}

标签:Nezzar,__,puts,int,CF1477A,Board
来源: https://blog.csdn.net/weixin_45911397/article/details/116244095