//Achen
#include<bits/stdc++.h>
#define For(i,a,b) for(int i=(a);i<=(b);i++)
#define Rep(i,a,b) for(int i=(a);i>=(b);i--)
#define Formylove return 0
const int N=5007;
typedef unsigned long long ULL;
typedef long double LD;
typedef long long LL;
typedef double db;
using namespace std;
template<typename T> void read(T &x) {
char ch=getchar(); x=0; T f=1;
while(ch!='-'&&(ch<'0'||ch>'9')) ch=getchar();
if(ch=='-') f=-1,ch=getchar();
for(;ch>='0'&&ch<='9';ch=getchar()) x=x*10+ch-'0'; x*=f;
}
//O(1)快速乘
LL ksc(LL a,LL b,LL p) {
LL rs=a*b-(LL)((LD)a/p*b+1.0e-8)*p;
return rs<0?rs+p:rs%p;
}
//模拟退火
const db T=1e5;
void solve() {
LL rs=0;
db t=T;
while(t>0.1) {
LL now;
if(now<rs||rand()<=exp((rs-now)/t)*RAND_MAX) rs=now;
else ;
t*=0.999;
}
}
void mnth() {
For(i,1,50) solve();
}
//奥妙较高精度开方
struct Num {
LL a; db b;
Num(){}
Num(LL a,db b):a(a),b(b){}
friend bool operator <(const Num&A,const Num&B) {
return A.a<B.a||(A.a==B.a&&A.b<B.b);
}
}ans;
Num operator +(const Num&A,const Num&B) {
Num rs=Num(A.a+B.a,A.b+B.b);
return Num(rs.a+(int)rs.b,rs.b-(int)rs.b);
}
Num get_sqrt(ULL x) {
if(x==0) return Num(0,0);
ULL a=(LL)sqrt(x);
while((a+1)*(a+1)<=x) a++;
return Num(a,(x-a*a)/(sqrt(x)+a));
}
void print(Num A) {
static char s[N];
sprintf(s,"%.15lf",A.b),
printf("%lld%s",A.a,s+1);
}
int main() {
//freopen("1.in","r",stdin);
//freopen("1.out","w",stdout);
Formylove;
}
记几个我老是忘记怎么写的和新学的小模板
最新推荐文章于 2024-02-23 22:24:29 发布