H_dream @ 2024-04-13 15:41:37
数据范围:1e6*5;
TLE看这:输入输出请用scanf和printf
最小数下标为0 不是1!!!
by Judy039 @ 2024-04-13 15:44:50
好
by Chizuru_Ichinose @ 2024-04-19 20:31:39
%%%
by WZwangchongming @ 2024-05-02 14:52:51
补一个:
ios::sync_with_stdio(0);
cin.tie(0); cout.tie(0);
喜欢cin的可以加上,相当于取消cincout缓冲区,可以极大提升cincout的效率。注意加上上面两行后,就不要cin和scanf,cout和printf混用了
另外,我喜欢快读快写[doge]
贴一个板子在这儿
namespace fastIO {
inline int read() {
int res = 0, f = 1;
char ch = getchar();
while( !(ch >= '0' && ch <= '9') ) {
if(ch == '-') f = -1;
ch = getchar();
}
while(ch >= '0' && ch <= '9') {
res = (res << 1) + (res << 3) + (ch ^ 48);
ch = getchar();
}
return res * f;
}
void write(int x) {
static int sta[35];
int top = 0;
do {
sta[top++] = x % 10;
x /= 10;
} while(x);
while(top) putchar(sta[--top] ^ 48);
}
void writeln(int x) {
write(x);
putchar('\n');
}
}