快读快写
作者:
划船全靠浪
,
2023-06-26 17:38:07
,
所有人可见
,
阅读 182
快读快写
板子题网址: https://www.luogu.com.cn/problem/U183572
struct IO {
template<typename T = int>
inline T read() {
T x = 0;
signed f = 1, ch = getchar();
while (!isdigit(ch)) f = ch == '-' ? -1 : 1, ch = getchar();
while (isdigit(ch)) x = x * 10 + ch - '0', ch = getchar();
return x * f;
}
template<typename T>
inline void write(T x) {
if (x < 0) x = -x, putchar('-');
if (x > 9) write(x / 10);
putchar(x % 10 + '0');
}
template<typename T>
inline void writes(T x) { write(x), putchar(' '); }
template<typename T>
inline void writeln(T x) { write(x), putchar('\n'); }
} io;
看看这个?
我这个主要是为了在比赛能用
我那个就是更像cin cout
而且那个nc()函数速度可以换成文件读入
效率会飞升
getchar也可以通过宏定义变成文件读入的
嗯