沙发
by かなで @ 2018-08-23 21:39:29
读入输出优化可以来一波
by EternalEpic @ 2018-08-23 21:56:32
template <class T> inline void read(register T &x)
{
register long long flag = 1;
x = 0; register char ch = getchar();
for( ; !isdigit(ch) ; ch = getchar() ) if(ch == '-') flag = -1;
for( ; isdigit(ch) ; ch = getchar() ) x = (x << 1) + (x << 3) + (ch ^ 48);
x *= flag;
}
template <class T> inline void write(register T x)
{
if (x < 0) putchar('-'), x = -x;
if (x > 9) write(x / 10);
putchar(x % 10 + '0');
}
template <class T> inline void writeln(register T x)
{
write(x);
puts("");
}
by EternalEpic @ 2018-08-23 21:56:55
```
template <class T> inline void read(register T &x)
{
register long long flag = 1;
x = 0; register char ch = getchar();
for( ; !isdigit(ch) ; ch = getchar() ) if(ch == '-') flag = -1;
for( ; isdigit(ch) ; ch = getchar() ) x = (x << 1) + (x << 3) + (ch ^ 48);
x *= flag;
}
template <class T> inline void write(register T x)
{
if (x < 0) putchar('-'), x = -x;
if (x > 9) write(x / 10);
putchar(x % 10 + '0');
}
template <class T> inline void writeln(register T x)
{
write(x);
puts("");
}
```
by EternalEpic @ 2018-08-23 21:57:19
@[刘兆洲](/space/show?uid=50925) 没用,才几千个数....
by かなで @ 2018-08-23 21:57:23
在下太蒟 程序不堪入目请见谅
by EternalEpic @ 2018-08-23 21:58:22
还有您的IO优化真的慢...
by かなで @ 2018-08-23 21:58:45
```
#pragma GCC optimize(3)
```
可以了解一下
by EternalEpic @ 2018-08-23 21:59:17
@[刘兆洲](/space/show?uid=50925) 还没有O2快...
by かなで @ 2018-08-23 21:59:58
或者(你的算法时间复杂度超了)
by EternalEpic @ 2018-08-23 22:00:15