快读快写
C++template <typename T>
void read(T &x) {
x = 0;
char ch = getchar();
int flag = 1;
while (!isdigit(ch)) {
if(ch == '-') flag = -1;
ch = getchar();
}
while (isdigit(ch)) {
x = x * 10 + ch - '0';
ch = getchar();
}
x *= flag;
}
template <typename T>
void write(T x) {
if (x >= 0 && x < 10) {
putchar(x + '0');
return ;
}
if (x < 0) {
putchar('-');
x *= -1;
}
int st[120], top = 0;
while (x > 0) {
st[top++] = x % 10 + '0';
x /= 10;
}
for (int i = top - 1; i >= 0; i--) putchar(st[i]);
}
OI-Wiki
Motrix
NthLink
贼歪贼欧姐
AFO on 2025.11.2