版本比较
模板
正文
增加 64 行删除 25 行
1234514 行未改动202122232324252627282425262728293031323334353637383940414243444546474849505152303132535455565758596061626364656634353637383940414243446768697071727374754748495076777879808182838485868788538990919293949596181 行未改动全部展开[洛谷互助](https://vjudge.net/util/luogu/captcha):::info[缺省源]{open}```cpp line-numbers#include <bits/stdc++.h>using namespace std;14 行未改动```::::::info[快读快写]```cpp line-numbersinline void read(ll& a){ a = 0; char c; bool negative = false; while ((c = getchar()) < 48 || c > 57){ if (c == '-') negative = true;#include <bits/stdc++.h>#ifdef __unix__#include <sys/mman.h>#include <sys/stat.h>#include <fcntl.h>#include <unistd.h>#endifusing namespace std;typedef long long ll;#ifdef __unix__uint8_t* str;#define gc() (*str++)#else#define gc() (_getchar_nolock())#endifll read(){ ll f = 1, k = 0; int8_t c = gc(); for (; c <= 32 && c > 0; c = gc()); for (; c == '-'; c = gc()) f *= -1; for (; c >= 48; c = gc()) k = (k << 3) + (k << 1) + (c ^ 48); return k * f;}ll s[35], t;char buf[1000500];ll top, msz = 1000000;void write(ll x){ if (x < 0){ buf[top++] = '-'; x = -x; } do a = a * 10 + (c ^ 48); while ((c = getchar()) >= 48 && c <= 57); if (negative) a = -a; if (x == 0) buf[top++] = '0'; t = 0; while (x){ s[t++] = x % 10; x /= 10; } while (t){ buf[top++] = s[--t] + '0'; } if (top > msz){ fwrite(buf, sizeof(buf[0]), top, stdout); top = 0; }}
inline void write(ll x){ if (x == 0) putchar('0'); else if (x < 0) putchar('-'), write(-x); else { static ll s[35], top = 0; while (x){ s[top++] = x % 10; x /= 10; } while (top) putchar(s[--top] + '0');void write(const char* s){ for (ll i = 0; s[i]; i++){ buf[top++] = s[i]; } if (top > msz){ fwrite(buf, sizeof(buf[0]), top, stdout); top = 0; }}inline void writestr(char *str){ ll len = strlen(str); for(ll i = 0; i < len; i++){ putchar(str[i]);void write(char c){ buf[top++] = c; if (top > msz){ fwrite(buf, sizeof(buf[0]), top, stdout); top = 0; }}int main(){#ifdef __unix__ struct stat s; fstat(0, &s); str = (uint8_t*) mmap(NULL, s.st_size, 1, 2, 0, 0);#endif*|* *|* fwrite(buf, sizeof(buf[0]), top, stdout); return 0;}```::::::info[高精度(暂未完结)]```cpp line-numbers181 行未改动全部展开