快读快写模版
read()
, write()
scanf()
, printf()
ios::sync_with_stdio(0)
+cin
,cout
cin
,cout
可见快读快写还是很厉害的
再加上 __int128
可以使用, 手写读入输出就很重要了
#include <bits/stdc++.h>
#define re register
#define lll __int128 // NOIp 开放部分带下划线的东西啦
using namespace std;
// 快读
lll read(){
lll sign=1,num=0;
char ch=getchar();
while(ch<'0' || ch>'9'){
if(ch=='-') sign=-1;
ch=getchar();
}
while(ch>='0' && ch<='9'){
num=num*10+ch-'0';
ch=getchar();
}
return num*sign;
}
// 快写
void write(lll x){
if(x<0){
putchar('-');
x=~x+1; // 相当于 x=-x
}
if(x>9) write(x/10);
putchar(x%10+'0');
}
int main()
{
ios::sync_with_stdio(0);
clock_t c1 = clock();
#ifdef LOCAL
freopen("data.in","r",stdin);
freopen("data.out","w",stdout);
#endif
// ======================================================================
lll x=read();
write(x);
// ======================================================================
end:
cerr << "Time Used:" << clock() - c1 << "ms" << endl;
return 0;
}
本文作者:咕噜咕噜酱
本文链接:https://www.cnblogs.com/syqwq/p/15225030.html
版权声明:本作品采用知识共享署名-非商业性使用-禁止演绎 2.5 中国大陆许可协议进行许可。
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步