若你使用了O(n)的方法仍TLE进
查看原帖
若你使用了O(n)的方法仍TLE进
232358
for_coding楼主2023/10/8 22:20

请使用快读而不是cin或scanf

void read(int &x){ 
	int f=1;x=0;char s=getchar();
	while(s<'0'||s>'9'){if(s=='-')f=-1;s=getchar();}
	while(s>='0'&&s<='9'){x=x*10+s-'0';s=getchar();}
	x*=f;
}
read(n);                        
2023/10/8 22:20
加载中...