今天做abc_e的时候使用了以下输入方式
template<typename T>inline void input(T &x){
char c='?';
bool flag=false;
x=0;
while(c=getchar(),!isdigit(c)){
if(c=='-'){
flag=true;
}
}
while(isdigit(c)){
x=x*10+(c-'0');
c=getchar();
}
if(flag){
x=-x;
}
}
signed main(){
ios::sync_with_stdio(false);
cin.tie(0),cout.tie(0);
cin>>n>>m>>y_;
for(int i=1;i<=n;++i){
for(int j=1;j<=m;++j){
input(a[i][j]);
}
}
}
(这里只保留了输入有关的部分)
可以看到加速了cin但同时使用了快读
本地样例AC,但提交到atcoder就包括样例数据全部TLE
把快读全改成cin就好了
有大佬能告诉这是为什么吗……