跳到正文

个人记录

114514

george0929约 4 分钟
原文
文章信息与版本

文章信息

发布
2023年8月26日
收录
2026年6月30日
更新
2026年11月8日
篇幅
约 4 分钟

版本

  1. v1当前

114514

C++
#include<bits/stdc++.h>
using namespace std;
#define int long long
string s[1005]={"11/(45-1)*4","-11+4-5+14","-11-4+5+14","11-4+5/1-4","11-4-5+14","1*1+45-14","11*4+5*1*4","1+1+(4+5)*14","(114-51)*4-11-4+5+14","1+1-4+514","1*(1+4)*51*4-11-4+5+14","-11+4*514+11*-4+51-4","(1+1)*451*4+(11*(45-1)+4)","114*5*14+((1+1)*4+51*4)","1145*14+((11-4)*51-4+(11/(45-1)*4))","114*51*4+((1+1)*4514+11*45-14+11*-4+51-4)","114*514+11*45*14-11/4+51/4","114514+1145*14+1*14+514"};
int tt=1;
void f(int x){ 
	if(x>=229028ll*229028ll*229028ll){
		int qp=1,pp=1;
		cout<<"(114514+114514)*(114514+114514)*(114514+114514)*(";
		int y=229028ll*229028ll*229028ll;
		tt=0;
		qp=y;
		y=x/y;
		pp=y;
		int pt=1,pos=17;
		for(int i=131072;i;i/=2){
			if(y>=i){
				y-=i;
				if(!pt) cout<<"+";
				pt=0;
				cout<<"("<<s[pos]<<")";
			}
			pos--;
		}
		cout<<")";
		x=x-qp*pp;
	}
	if(x>=229028ll*229028ll){
		int qp=1,pp=1;
		if(!tt) cout<<'+';
		cout<<"(114514+114514)*(114514+114514)*(";
		int y=229028ll*229028ll;
		tt=0;
		qp=y;
		y=x/y;
		pp=y;
		int pt=1,pos=17;
		for(int i=131072;i;i/=2){
			if(y>=i){
				y-=i;
				if(!pt) cout<<"+";
				pt=0;
				cout<<"("<<s[pos]<<")";
			}
			pos--;
		}
		cout<<")";
		x=x-qp*pp;
	}
	if(x>=229028){
		int qp=1,pp=1;
		if(!tt) cout<<'+';
		cout<<"(114514+114514)*(";
		int y=229028ll;
		tt=0;
		qp=y;
		y=x/y;
		pp=y;
		int pt=1,pos=17;
		for(int i=131072;i;i/=2){
			if(y>=i){
				y-=i;
				if(!pt) cout<<"+";
				pt=0;
				cout<<"("<<s[pos]<<")";
			}
			pos--;
		}
		cout<<")";
		x=x-qp*pp;
	}
	while(x>=114514){
		if(!tt) cout<<"+";
		tt=0;
		cout<<"114514";
		x-=114514;
	}
	int pos=17; 
	for(int i=131072;i;i/=2){
		if(x>=i){
			x-=i;
			if(!tt) cout<<"+";
			tt=0;
			cout<<"("<<s[pos]<<")";
		}
		pos--;
	}
}
int n;
signed main(){
	cout<<"欢迎使用恶臭数字生成器,请输入小于等于9223372036854775807的正整数\n"; 
	cout<<"by LUOGU_UID:377969\n";
	while(cin>>n){
		cout<<n<<"=";
		f(n);
		tt=1;
		cout<<"\n-----\n";
	}
	return 0;
}
原文