版本比较
快读快写
正文
增加 54 行删除 27 行
12345656778910111213121415161718191820212223247 行未改动3233343534353637383940414243444546474849505152363738395540414243444546474849615051525354555657585960616263646566676869707172737475767778798081828384858687888990916592```cpp
namespace FASTIO{#ifdef __linux__ char *left, *right, s[100000]; uint8_t out[(1 << 22) + (1 << 5)], c[1 << 5], *now = out; #define gtchar() (left == right && (right = (left = s) + fread(s, 1, 100000, stdin), left == right) ? EOF : *left++) #define ptchar(x) (now++[0] = (x)) uint8_t out[(1 << 18) + (1 << 5)], c[1 << 5], *now = out;#define gtchar() (left == right && (right = (left = s) + fread(s, 1, 100000, stdin), left == right) ? EOF : *left++)#define ptchar(x) now++[0] = x; ll read() { char a = gtchar(); ll ans = 0, f = 1; while (a < '0' || a > '9') while (!isdigit(a)) { if (a == '-') f = -1; a = gtchar(); } while (a >= '0' && a <= '9') while (isdigit(a)) { ans = (ans << 3) + (ans << 1) + (a ^ 48); a = gtchar(); }7 行未改动 return; } uint8_t *cnt = c + 32; (x < 0) && (now++[0] = 45, x = -x); (x) && ((--cnt)[0] = x % 10 ^ 48, x /= 10), (x) && ((--cnt)[0] = x % 10 ^ 48, x /= 10), (x) && ((--cnt)[0] = x % 10 ^ 48, x /= 10), (x) && ((--cnt)[0] = x % 10 ^ 48, x /= 10), (x) && ((--cnt)[0] = x % 10 ^ 48, x /= 10), (x) && ((--cnt)[0] = x % 10 ^ 48, x /= 10), (x) && ((--cnt)[0] = x % 10 ^ 48, x /= 10), (x) && ((--cnt)[0] = x % 10 ^ 48, x /= 10), (x) && ((--cnt)[0] = x % 10 ^ 48, x /= 10), (x) && ((--cnt)[0] = x % 10 ^ 48, x /= 10), (x) && ((--cnt)[0] = x % 10 ^ 48, x /= 10), (x) && ((--cnt)[0] = x % 10 ^ 48, x /= 10), (x) && ((--cnt)[0] = x % 10 ^ 48, x /= 10), (x) && ((--cnt)[0] = x % 10 ^ 48, x /= 10), (x) && ((--cnt)[0] = x % 10 ^ 48, x /= 10), (x) && ((--cnt)[0] = x % 10 ^ 48, x /= 10), (x) && ((--cnt)[0] = x % 10 ^ 48, x /= 10), (x) && ((--cnt)[0] = x % 10 ^ 48, x /= 10), (x) && ((--cnt)[0] = x % 10 ^ 48, x /= 10); while (x) (--cnt)[0] = x % 10 ^ 48, x /= 10; memmove(now, cnt, c + 32 - cnt); now += c + 32 - cnt; if (now - out > (1 << 22)) if (now - out > (1 << 18)) { fwrite(out, 1, now - out, stdout); now = out; } } void end() { fwrite(out, 1, now - out, stdout); } #undef gtchar#undef gtchar#else#define gtchar() _getchar_nolock()#define ptchar(x) _putchar_nolock(x) ll read() { char a = gtchar(); ll ans = 0, f = 1; while (!isdigit(a)) { if (a == '-') f = -1; a = gtchar(); } while (isdigit(a)) { ans = (ans << 3) + (ans << 1) + (a - '0'); a = gtchar(); } return ans * f; } void write(ll x) { if (x < 0) { x = -x; ptchar('-'); } if (x / 10) { write(x / 10); } ptchar(x % 10 + '0'); }
void end() { }#endif};```
需要在程序末尾也 ```fwrite(out, 1, now - out, stdout);``` 一下。需要在程序末尾也 ```end();``` 一下。