编译器问题?
  • 板块学术版
  • 楼主Phrvth
  • 当前回复2
  • 已保存回复2
  • 发布时间2024/5/4 00:23
  • 上次更新2024/5/4 09:52:16
查看原帖
编译器问题?
520544
Phrvth楼主2024/5/4 00:23

我使用的是 CP Editor

在使用快读的时候,比如使用 read(n); 时,必须要配上 ios :: sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); 才能运行,不然就会显示 TLE 快读模版如下:

template < typename T > void read(T &x) {
	x = 0; char s = getchar(); bool f = 0;
	while (! isdigit(s)) { f = s == '-'; s = getchar(); }
	while (  isdigit(s)) { x = x * 10 + s - 48; s = getchar(); } if (f) x = -x; 
}
template < typename T > void write(T x) {
	if (x < 0) { putchar('-'), x = -x; }
	if (x > 9) write(x / 10);
	putchar(x % 10 + '0');
}

为啥呢?

2024/5/4 00:23
加载中...