测试点数据自测无误,WA 0 分求调

P2613 【模板】有理数取余

可能是快读的问题,这是我第一次写快读。
by lzy20091001 @ 2024-03-29 23:10:18


已 AC,方法是在快读中加特判 ```cpp int read() { int res = 0; char ch = getchar(); while (!isdigit(ch)) // 特判 ch = getchar(); while (isdigit(ch)) { res = (1ll * res * 10 + ch - '0') % P; ch = getchar(); } return res; } ``` 但是这是为什么?为什么需要特判?为什么在本地测试没有问题?
by lzy20091001 @ 2024-03-29 23:13:27


|