2025.8.25 红祭 2025.11.24 AC1000祭
111111
瑟瑟hwy的超长数据结构介绍
codeforces
樱花动漫
Aizu OJ
Loj
莫队博客
acwing名字:芙芙芙芙芙芙
学校官网
幼爽哥传送门
梦熊联盟
专题学习
OI wiki
#include<bits/stdc++.h>
using namespace std;
int main(){
while(1){
system("data.exe > in.txt");
system("baoli.exe < in.txt > out.txt");
system("std.exe < in.txt > ans.txt");
if(system("fc out.txt ans.txt"))break;
}
return 0;
}inline __int128 read(){
__int128 x=0,h=1;
char ch=getchar();
while(ch<'0'||ch>'9'){
if(ch=='-')h=-1;
ch=getchar();
}
while(ch>='0'&&ch<='9'){
x=(x<<3)+(x<<1)+ch-'0';
ch=getchar();
}
return x*h;
}
void print(__int128 x){
if(x>9)print(x/10);
putchar(x%10+'0');
}
关于__int128的一些注意事项:
1,__int128的读入输入不在C++库里面,要单独写读入输出
2,__int128的使用与编译器本身的优化有关,它进行加减乘除等运算的时候是要进行位数的对齐的,若你将int,long long等常用的类型强制赋值给__int128,编译器自身优化可能出现问题,__int128无法对齐,运算可能就会出现问题,无法得到正确结果或是RE,解决方法也很简单,要么全部用long long,要么全部用__int128即可解决此问题,也可以重载强制赋值操作,使得long long强制转成__int128的时候可以对齐,不会出现错误。传送门 Vjudge网址 名字:chenxuanlin10086
女仆之心乃掌中人偶 超好听
游戏玩法说明 :
https://app7408.acapp.acwing.com.cn/kob/
Web端游戏地址 :
https://app7426.acapp.acwing.com.cn/
超级大快读:
namespace fast_IO {
#define IOSIZE 100000
static unsigned int precision = 6, POW[10] = {1, 10, 100, 1000, 10000, 100000, 1000000, 10000000, 100000000, 1000000000};
static char obuf[IOSIZE], *p3 = obuf;
#ifdef ONLINE_JUDGE
static char ibuf[IOSIZE], *p1 = ibuf, *p2 = ibuf;
#define getchar() ((p1==p2)and(p2=(p1=ibuf)+fread(ibuf,1,IOSIZE,stdin),p1==p2)?(EOF):(*p1++))
#endif
#define putchar(x) ((p3==obuf+IOSIZE)&&(fwrite(obuf,p3-obuf,1,stdout),p3=obuf),*p3++=x)
inline int64_t read() { int64_t s = 0; int w = 1; char ch; while (ch = getchar(), !(ch>47 and ch<58) and (ch != EOF)) if (ch == '-') w = -1; if (ch == EOF) return false; while ((ch>47 and ch<58)) s = s * 10 + ch - 48, ch = getchar(); return s * w; }
template<typename T> static inline bool read(T &s) { s = 0; int w = 1; char ch; while (ch = getchar(), !(ch>47 and ch<58) and (ch != EOF)) if (ch == '-') w = -1; if (ch == EOF) return false; while ((ch>47 and ch<58)) s = s * 10 + ch - 48, ch = getchar(); return s *= w, true; }
template<typename T> static inline void print(T x) { if (x < 0) putchar('-'), x = -x; if (x > 9) print(x / 10); putchar(x % 10 + 48); }
static inline bool read(char &s) { while (s = getchar(), isspace(s) and s != EOF); return s != EOF; }
static inline void print(char x) { putchar(x); }
static inline bool read(char *s) { char ch; while (ch = getchar(), (ch<33) && ch != EOF); if (ch == EOF) return false; while (!(ch<33) and (ch != EOF)) *s++ = ch, ch = getchar(); *s = '\0'; return true; }
static inline void print(char *x) { while (*x) putchar(*x++); }
static inline void print(const char *x) { for (int i = 0; x[i]; i++) putchar(x[i]); }
static inline bool read(std::string& s) { s = ""; char ch; while (ch = getchar(), (ch<33) and ch != EOF); if (ch == EOF) return false; while (!(ch<33)) s += ch, ch = getchar(); return true; }
static inline void print(std::string x) { for (int i = 0, n = x.size(); i < n; i++) putchar(x[i]); }
static inline bool read(bool &b) { char ch; while(ch=getchar(), (ch<33) and ch != EOF); return ch == EOF ?false :(b=ch^48, true); }
static inline void print(bool b) { putchar(b+48); }
static inline bool read(double &x) { char ch = getchar(); int f = 1; for(; (ch<48 or 57<ch) and (ch != EOF); ch=getchar()) if(ch == '-') f = -1; if(ch == EOF) return false; for(x=0; 47<ch and ch<58; ch=getchar()) x = x*10 + (ch^48); if(ch != '.') return x *= f, true; double y = 0.1; for(ch=getchar(); 47<ch and ch<58; ch=getchar()) x += y*(ch^48), y /= 10; return x *= f, true; }
static inline void print(double x) { if(x < 0) putchar('-'), x = -x; if(!precision) print((unsigned long long)(x-(unsigned long long)(x)>=0.5 ?x+1 :x)); else { unsigned long long xx = x; double y = ((x-xx)*POW[precision]); unsigned long long yy = (y-(unsigned long long)(y)>=0.5 ?y+1 :y); if(yy == POW[precision]) xx++, yy = 0; print(xx), putchar('.'); for(int j=precision-1; ~j; j--) putchar(48+yy/POW[j]%10); } }
template<typename T, typename... T1> static inline int read(T& a, T1&... other) { return read(a) + read(other...); }
template<typename T, typename... T1> static inline void print(T a, T1... other) { print(a), print(other...); }
static struct Fast_IO {
bool flag = 1;
inline ~Fast_IO() { fwrite(obuf, p3 - obuf, 1, stdout); }
inline void SetPrecision(int x) { if(x > 9) throw runtime_error("Precision too high!"); else if(x < 0) throw runtime_error("Precision too low!"); else precision = x; }
inline operator bool() { return flag; }
} io;
Fast_IO& operator >> (Fast_IO &io, char *b) { return io.flag &= read(b), io; }
template<typename T> static Fast_IO& operator >> (Fast_IO &io, T &b) { return io.flag &= read(b), io; }
template<typename T> static Fast_IO& operator << (Fast_IO &io, T b) { return print(b), io; }
#define cout io
#define cin io
#define endl '\n'
} using namespace fast_IO;