帮帮忙,调了1小时了
  • 板块灌水区
  • 楼主ClapEcho233
  • 当前回复0
  • 已保存回复0
  • 发布时间2020/10/4 12:48
  • 上次更新2023/11/5 12:04:14
查看原帖
帮帮忙,调了1小时了
321619
ClapEcho233楼主2020/10/4 12:48

骗分过样例这题9,10两个数据点RE,求各位dalao康康哪里错了

#include<bits/stdc++.h>
using namespace std;
#define Tp template<typename Ty>
#define Ts template<typename Ty,typename... Ar>
#define Reg register
#define RI Reg int
#define RL Reg LL
#define RU Reg ull
#define Con const
#define CI Con int&
#define CL Con LL&
#define CU Con ull&
#define I inline
#define W while
#define LL long long
#define ULL unsigned long long
#define max(x,y) ((x)>(y)?(x):(y))
#define min(x,y) ((x)<(y)?(x):(y))
#define Gmax(x,y) (x<(y)&&(x=(y)))
#define Gmin(x,y) (x>(y)&&(x=(y)))
int tot,pr[10001000];
bool ck[10001000];
I LL mul(LL a,LL b,LL p){a%=p;b%=p;long long c=(long double)a*b/p;long long ans=a*b-c*p;if(ans<0) ans+=p;else if(ans>=p) ans-=p;return ans;}
I LL mi(LL x,LL p,LL m){LL r=1;while(p){if(p&1LL)r=mul(r,x,m);p>>=1;x=mul(x,x,m);}return r;}
I LL read(){LL f=1,x=0;char ch=getchar();while(!isdigit(ch)){if(ch=='-')f=-1;ch=getchar();}while(isdigit(ch))x=(x<<3)+(x<<1)+(ch^48),ch=getchar();return x*f;}
I LL readd(LL X){LL f=1,x=0;char ch=getchar();while(!isdigit(ch)){if(ch=='-')f=-1;ch=getchar();}while(isdigit(ch))x=((x<<3)+(x<<1)+(ch^48))%X,ch=getchar();return x*f;}
void write(LL x){if(x<0)putchar('-'),x=-x;if(x>9)write(x/10);putchar((x-x/10*10)+'0');}
void ini(int n){
	ck[1]=1;
	for(int i=2;i<=n;i++){
		if(!ck[i]) pr[++tot]=i;
		for(int j=1;j<=tot;j++){
			if(i*pr[j]>n) break;
			ck[i*pr[j]]=1;
			if(i%pr[j]==0) break;
		}
	}
}
class ks{
	public:
		void sor(LL m){
			LL n=read();
			for(LL i=1,q;i<=n;i++){
				q=readd(m-1);
				write(mi(19,q,m));
				putchar('\n');
			}
		}
}we;
class waks{
	private:
		#define X 55244
		#define Y 45699
		int a[X+Y+10];
		LL n,i,x;
	public:
		I void sor(){
			for(a[0]=i=1;i<=X+Y;i++){
				a[i]=19*a[i-1]%998244353;
			}
			n=read();
			while(n--){
				x=read();
				write(a[x<=X?x:(x-X)%Y+X]);
				putchar('\n');
			}
		}
}wawe;
class MillerRabin{
	public:
		bool M_R(LL x,int t){
			if(x<=4e6) return !ck[x];
			for(int i=1;i<=30;i++) if(x%pr[i]==0) return 0;
			for(int i=1;i<=t;i++){
				LL y=pr[i];
				if(mi(y,x-1,x)!=1) return 0;
				LL v=x-1,t=1;
				while(t==1 && ~v&1){
					t=mi(y,v>>=1,x);
					if(t!=1&&t!=x-1) return 0;
				}
			}return 1;
		}
}MR;
class _2p{
	private:
		LL l,r,n;
	public:
		I void prime(){
			n=read();
			W(n--){
				l=read();r=read();
				for(int i=l;i<=r;i++){
					putchar(MR.M_R(i,5)?'p':'.');
				}
				putchar('\n');
			}
		}
}Pr;
int main(){

	string s;
	getline(cin,s);
	ini(10000000);
	if(s=="1_998244353")we.sor(998244353);
	if(s=="1?")we.sor(1145141);
	if(s=="1?+")we.sor(5211600617818708273);
	if(s=="1wa_998244353")wawe.sor();
	if(s=="2p")Pr.prime();

	return 0;
}
2020/10/4 12:48
加载中...