哦,不好意思,快读少了一行
```cpp
if(flag) dig = -dig
```
$qwq$打扰了
by Fraction @ 2018-08-24 20:43:47
你没判负数,最后要乘起来。
by ybw051114 @ 2018-08-24 20:44:09
@[Fraciton](/space/show?uid=32107) 你的快读是假的。我帮你改了一下(~~未实测AC~~)
```cpp
template <typename T> il void read(T &dig) {
char c = getchar();
bool flag = false;
dig = 0;
while(!isdigit(c) && c != '-') c = getchar();
if(c == '-') flag = true, c = getchar();
while(isdigit(c)) dig = dig * 10 + c - '0', c = getchar();
if(flag) dig = -dig; //就是这!!!
}
```
by AThousandSuns @ 2018-08-24 20:45:04
@[AThousandSuns](/space/show?uid=72118) 谢谢
by Fraction @ 2018-08-24 20:45:48
@[ybw051114](/space/show?uid=74346) 谢谢
by Fraction @ 2018-08-24 20:45:54
@[Fraciton](/space/show?uid=32107) 还是用这个吧~~逃~~
https://www.luogu.org/blog/Howershine950644/post-mu-ban-zhen-zheng-di-du-xie-you-hua
by A星际穿越 @ 2018-08-24 20:47:16
@[A星际穿越](/space/show?uid=62138) ~~考场上打完这个别人都写完T1了~~
by Fraction @ 2018-08-24 20:48:57