关于读入
查看原帖
关于读入
592895
y_kx_b楼主2022/9/25 11:41
namespace Quick_Read{
	static const int Buf_sz=1<<19;
	static char buf[Buf_sz],*p1=buf,*p2=buf;
	inline char gc(){
		return(p1==p2&&(p2=(p1=buf)+fread(buf,1,Buf_sz,stdin),p1==p2)?-1:*p1++);
	}
}using Quick_Read::gc;
void scanf_s(char *str,bool line=0){
	char ch=gc();
	while(ch>32-line)*str++=ch,ch=gc();
	*str=0;
}
int read(){
	int x=0;char ch=gc();
	while(!isdigit(ch))ch=gc();
	while(isdigit(ch))
		x=(x*10)+(ch^48),ch=gc();
	return x;
}
	n=read();
	for(int i=1;i<=n;i++){
		scanf("%s",str);
		for(int j=1;j<=n;j++)
			s[i][j]=str[j-1]^48;
	}

感觉没问题,可交上去听取wa声一片(0pts)。改成 scanf 就过了。快读求找错 qwq

2022/9/25 11:41
加载中...