跳到正文

剪贴板

剪贴板 2d5bpfjb

原文
剪贴板信息

剪贴板信息

收录
更新
C++
/*
UMCM(Unreadable Mozheng Code Maker)
* ver 1.3.1
* Authors: CYX LJC
* Code Size:26.0KB
* How to Use:This is a code to let your solutions be unreadable.There are 4 different types of settings:
  - If you open mode xiahuaxian, you will see the variables and functions become lots of underlines.
  - If you don't open it, they will look like "_NaMe_000" and keywords become misleading words with random strings.
  - If you set codetype to 0, the code will looks like a BEAUTIFUL semi-circle.
  - If you set codetype to 1, the code will looks like a LONG noodle.
  - If you set codetype to 2, you will see a BEAUTIFUL code and you will shout 'what the f***?!'!
  - If you set codetype to 3, you will see a code which every lines' length is between _MIN_..._ ~ _MAX_..._
  - If you open randomstr, all the strings in your code will be a strange thing.
  - If you don't open it, you can continue use it to get the right output.
* Run it in Linux: g++ UMCM.cpp -std=c++14 -o umcm && ./umcm < yourcode.cpp > resultcode.cpp
* Run it in Windows(Use cmd): g++ UMCM.cpp -std=c++14 -o umcm && umcm.exe < yourcode.cpp > resultcode.cpp
* Have a Good Day! Be happy and mozheng! =)

Updates
- ver 1.1: fixed the bug of notes.
  - ver 1.1.2: delete all notes in input code and fixed the bug of define, ifdef and undef, now you can use UMCM to change itself with no errors!
  - ver 1.1.3: it dead. well, we let the code change a lot, and it takes lots of bugs.
  - ver 1.1.4: we can fix all the known bugs now!
  - ver 1.1.5: now you can run the code perfectly even it has many "\", fixed the strange things in mz mode.
  - ver 1.1.6: your output will be random strings when define dntac, and open a new mode 'wtf'!!! now you can use UMCM in any modes!!!!!!
  - ver 1.1.7: last version author forget to update on luogu, this time fixed some little bug.
- ver 1.2: change the names and ways to choose the code's types, and fixed some cryptic bugs. Added codetype-3 and 4 types to add spaces.
  - ver 1.2.1: Accelerated the speed of code, now you can UMCM itself in 0.2s!!!
- ver 1.3: now all digits will be represented as an expression composed of 1,1,4,5,1,4 and operational symbols! Source of inspiration: https://lab.magiconch.com/homo/
  - ver 1.3.1: last version is so big even close to 50KB, so this time change a way to initialize the basic mozheng digits.
*/
#include<bits/stdc++.h>
#include<cstdlib>
using namespace std;
//Arguments Part
const bool _MODE_XIAHUAXIAN=0;//open xiahuaxian mode
const int _MODE_CODETYPE=0;//0:semi-circle 1:noodle 2:lots of line 3:random line feed
const int _MODE_ADDSPACE=0;//0:keep space in old code 1:clear every space 2:add every space 3:random space
const int _MIN_CHARACTERS_A_LINE=30;//abled when use codetype 3
const int _MAX_CHARACTERS_A_LINE=100;
const bool _MODE_RANDOM_STR=0;//let every string be random
//Variable Part
int varcnt;
string a[1000010];
string b[1000010];
bool dntdef[1000010];
int sz=0;
int nxt[1000010],d[1000010],e[1000010];
set<string> vars;
map<string,string> def;
string ans,a2,aans;
string zifuji="_0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
bool ins,ins2;
bool inm;
struct kuohao{
	int type;//0:{} 1:() 2:[]
	vector<string> inside;
	vector<int> chs;
	int fa;
	kuohao(int tp=3,int f=0){
		type=tp;fa=f;
		inside.clear();chs.clear();
	}
};
vector<kuohao> AllBrackets;int BracketsNowpos,brackets_CNT;
string tmp;
int f[10005],fcnt,sum,r;
int nowto=0,ffcnt=0;
string toecc[300010];
set<int>hasec;
map<double,string> dp[15][15];
string brac_s;
int match[355],lvl[355];
string calc_res;
void mozhengdig_init();
mt19937 rad((unsigned long long)new char);
int rd(){return abs((int)rad());}
inline void DEF_init();
inline void DEF_out();
//Basic Part
bool cbv(char c){return c>='a'&&c<='z'||c>='A'&&c<='Z'||c=='_'||c>='0'&&c<='9';}
string i2s(int n){string ans="";if(n>9) ans+=i2s(n/10);ans+=char(n%10+48);return ans;}
long long tonum(string s,int st,int base){long long ans=0,b=1,bs=base;for(int i=s.length()-1;i>=st;i--){ans+=b*(s[i]>=97?s[i]-87:s[i]>=65?s[i]-55:s[i]-48);b*=bs;}return ans;}
bool in(char x){return x>='a'&&x<='z'||x>='A'&&x<='Z'||x>='0'&&x<='9'||x=='_'||x=='\"'||x=='\'';}
char rdchr(){return zifuji[rd()%zifuji.length()];}
string rdstr(int mxlen){
	int len=rd()%(mxlen/2)+mxlen/2;string s;
	for(int i=1;i<=len;i++) s+=rdchr();
	return s;
}
string d2s(long double n){
	char ans[335];sprintf(ans,"%.20Lf",n);
	int l=strlen(ans);string S;
	for(int i=0;i<l;i++) S+=ans[i];
	return S;
}
string repstr(string s,int times){
	string ans;while(times--) ans+=s;
	return ans;
}
//Mozheng Digit Part
pair<string,string> to_usual(string s){
	string houzhui="";
	while(*s.rbegin()<48||*s.rbegin()>57) houzhui=*s.rbegin()+houzhui,s.pop_back();
	//0x... 0b... 0... .e....
	if(s[0]=='0'&&(s.length()>1&&s[1]!='.')){
		if(s[1]=='x') return {to_string(tonum(s,2,16)),houzhui};
		if(s[1]=='b') return {to_string(tonum(s,2,2)),houzhui};
		return {to_string(tonum(s,1,8)),houzhui};
	}
	if((int)s.find('e')==-1) return {s,houzhui};
	houzhui="db";
	long double ans=0,tmp=1.0;long long aftere=0;
	bool dot=0,e=0,f1=0,f2=0;
	for(int i=0;i<s.length();i++){
		if(s[i]=='e'){e=1;continue;}
		if(s[i]=='.'){dot=1;continue;}
		if(!e){
			if(s[i]=='-'){f1=1;continue;}
			if(!dot) ans=ans*10+s[i]-48;
			else tmp/=10,ans+=tmp*(s[i]-48);
		}else{
			if(s[i]=='-'){f2=1;continue;}
			aftere=aftere*10+s[i]-48;
		}
	}
	if(f1) ans*=-1;
	if(f2) aftere*=-1;
	if(aftere>308) return {"inf",houzhui};
	if(aftere<-323) return {"0",houzhui};
	if(aftere>0) for(int i=1;i<=aftere;i++) ans*=10;
	else for(int i=1;i<=-aftere;i++) ans/=10;
	return {d2s(ans),houzhui};
}
string operator /(string a,int b){
    string c;
    int r=0;
    bool asdf=0;
	for(int i=0;i<a.length();i++){
		r=r*10+a[i]-48;
		if(r/b||asdf) asdf=1,c+=char(r/b+48);
		r%=b;
	}
    return c;
}
int operator %(string a,int b){
    int r=0;
	for(int i=0;i<a.length();i++){
		r=r*10+a[i]-48;
		r%=b;
	}
    return r;
}
string mozheng_bigint(int a,bool abc){
    auto it=upper_bound(hasec.begin(),hasec.end(),a);
    it--;
    int b=*it;
    if(a==b) return (abc?"(":"")+toecc[b]+(abc?")":"");
    if(a/b==1) return (abc?"(":"")+toecc[b]+"+"+mozheng_bigint(a%b,1)+(abc?")":"");
    return (abc?"((":"(")+toecc[b]+")*("+mozheng_bigint(a/b,0)+")+"+mozheng_bigint(a%b,1)+(abc?")":"");
}
string mozheng_int(string a,bool abc){
    if(a.length()<=6) return mozheng_bigint(tonum(a,0,10),0);
    return (abc?"((":"(")+toecc[229028]+")*("+mozheng_int(a/229028,0)+")+"+mozheng_bigint(a%229028,1)+(abc?")":"");
}
string mozheng_dig(pair<string,string> S){
	string s=S.first,hz=S.second;
    string a,b;
    a=b="";
    bool l=0;
    for(int i=0;i<s.length();i++){
        if(s[i]=='.'){
            l=1;
            continue;
        }
        if(l==0) a+=s[i];
        else b+=s[i];
    }
    if(l){
        if(a==""||a=="0") return "(double)("+mozheng_int(b,0)+")"+repstr("/(-11/4+51/4)",b.length());
        return mozheng_int(a,1)+"+(double)("+mozheng_int(b,0)+")"+repstr("/(-11/4+51/4)",b.length());
    }else return (hz=="ll"?"(long long)(":hz=="ull"?"(unsinged long long)(":hz=="db"?"(double)(":"(int)(")+mozheng_int(a,0)+")";
}
string mozhengdig(pair<string,string> s){return "("+mozheng_dig(s)+")";}
//Useless Brackets Deleting Part
bool isnum(int l,int r){
    bool f=brac_s[l]>=48&&brac_s[l]<=57||brac_s[l]=='-'||brac_s[l]=='+';
    for(int i=l+1;i<=r;i++) f&=brac_s[i]>=48&&brac_s[i]<=57;
    return f;
}
void brac_init(){
    stack<int> st;
    stack<bool> g;
    for(int i=0;i<brac_s.length();i++){
        match[i]=-1;
        if(brac_s[i]=='(') st.push(i),g.push(0);
        if(brac_s[i]==')'){
            match[i]=st.top();
            match[st.top()]=i;
            lvl[i]=lvl[st.top()]=g.top();
            g.pop();
            st.pop();
        }
        if((brac_s[i]=='+'||brac_s[i]=='-'||brac_s[i]=='/'||brac_s[i]==' ')&&!g.empty()) g.pop(),g.push(1);
    }
}
void brac_calc(int l,int r,int lv,bool chai){
    if(l>r) return;
    if(match[r]==l){
        if(!chai&&lvl[l]) calc_res+='(';
        brac_calc(l+1,r-1,1,1);
        if(!chai&&lvl[r]) calc_res+=')';
        return;
    }
    if(isnum(l,r)||brac_s.substr(l,r-l+1)=="double"){
        for(int i=l;i<=r;i++) calc_res+=brac_s[i];
        return;
    }
    for(int i=r;i>=l;i--){
        if(brac_s[i]==')') i=match[i];
        else{
            if(lv>=1){
                if(brac_s[i]=='+'||brac_s[i]=='-'){
                    brac_calc(l,i-1,2,1);
                    calc_res+=brac_s[i];
                    brac_calc(i+1,r,2,0);
                    return;
                }
            }
            if(lv>=2){
                if(brac_s[i]=='*'||brac_s[i]=='/'){
                    brac_calc(l,i-1,3,0);
                    calc_res+=brac_s[i];
                    brac_calc(i+1,r,3,0);
                    return;
                }
            }
			if(brac_s[i]==' '){
				calc_res+="(double)";
				brac_calc(i+1,r,1,0);
				return;
			}
        }
    }
    brac_calc(l,r,lv+1,chai);
}
//String Find&Get Variables Part
bool yinhao(int& i,const string& x,string& ans){
	while(x[i]=='\\'&&i<x.size()-1)ans+=x[i++],ans+=x[i++];
	if(i==x.size()-1&&x[i]=='\\') return 1;
	if(x[i]=='"') return ins=0,ans+=x[i],0;
	if(_MODE_RANDOM_STR) ans+=rdchr();
	else ans+=x[i];
	return i>=x.size();
}
bool yinhao2(int& i,const string& x,string& ans){
	while(x[i]=='\\'&&i<x.size()-1)ans+=x[i++],ans+=x[i++];
	if(i==x.size()-1&&x[i]=='\\') return 1;
	if(x[i]=='\'') return ins2=0,ans+=x[i],0;
	if(_MODE_RANDOM_STR) ans+=rdchr();
	else ans+=x[i];
	return i>=x.size();
}
void addvar(const string& t){
	if(!vars.count(t)){
		vars.insert(t);++varcnt;
		string to;
		if(_MODE_XIAHUAXIAN){to="$";for(int j=1;j<=varcnt;++j)to+="_";}
		else to="$_NaMe_"+i2s(varcnt);
		def[t]=to;
	}
}
inline string repla(const string& x,const string& s,const string& t,int mode);
void getvars(string &s){
	int l=s.length();
	string t;
	int pos=0;char ch;
	while(pos<l){
		ch=s[pos];
		if(!ins2&&!ins&&s[pos]=='"'&&((!pos)||s[pos-1]!='\\')){t="";ins=1;t+=s[pos++];}
		if(!ins&&!ins2&&s[pos]=='\''&&((!pos)||s[pos-1]!='\\')){t="";ins2=1;t+=s[pos++];}
		if(ins){
			if(yinhao(pos,s,t)) break;
			pos++;
			if(!ins) addvar(t);
			continue;
		}
		if(ins2){
			if(yinhao2(pos,s,t)) break;
			pos++;
			if(!ins2) addvar(t);
			continue;
		}
		if(cbv(ch)){
			if(pos>0&&s[pos-1]=='$'){
				while(pos<l&&cbv(s[pos])) pos++;
				continue;
			}
			bool isdig=0;
			if(ch>='0'&&ch<='9') isdig=1;
			t="";
			int st=pos;
			while(pos<l&&cbv(s[pos])) t+=s[pos++];
			if(isdig&&(s[pos]=='.'||s[pos]=='-'&&s[pos-1]=='e')){
				t+=s[pos++];
				while(pos<l&&cbv(s[pos])) t+=s[pos++];
			}
			int ed=pos-1;
			if(isdig){
				string tmp=mozhengdig(to_usual(t));
				s=s.substr(0,st)+tmp+s.substr(ed+1,s.length()-ed-1);
				l=s.length();
				t=tmp;
				pos=st+tmp.length()+1;
			}
			addvar(t);
			continue;
		}
		pos++;
	}
}
inline void getnxt(const string& s,const string& t,int n,int m,int *ans,bool st){
	register int a(0),p(0);nxt[0]=n;
	for(int i=st;i<m;i++){
		if(i>=p||i+nxt[i-a]>=p){
			if(i>p)p=i;
			while(p<m&&t[p]==s[p-i])p++;
			ans[i]=p-i,a=i;
		}
		else ans[i]=nxt[i-a];
	}
}
inline string repla(const string& x,const string& s,const string& t,int mode){//mode=0:test mode=1:no test mode=2:delete mid
	getnxt(s,s,s.size(),s.size(),nxt,1),getnxt(s,x,s.size(),x.size(),d,0);
	if(mode==2){
		getnxt(t,t,t.size(),t.size(),nxt,1),getnxt(t,x,t.size(),x.size(),e,0);
	}
	bool jntm=0;
	string ans="";
	for(int i=0;i<x.size();i++){
		if(inm){
			if(mode==2&&e[i]==t.size()){
				inm=0;
				i+=t.size()-1;
			}
			continue;
		}
		if(ins){
			if(yinhao(i,x,ans)) break;
			continue;
		}
		if(ins2){
			if(yinhao2(i,x,ans)) break;
			continue;
		}
		if(d[i]==s.size()){
			if(mode>0||((!i)||(!in(x[i-1])))&&(i>=x.size()-1||(!in(x[i+s.size()])))&&x[i-1]!='$'){
				if(mode==2){
					inm=1;
					continue;
				}
				if(s=="//") return ans;
				ans+=t,i+=s.size()-1;
			}else ans+=x[i];
			continue;
		}
		if(!ins2&&!ins&&x[i]=='"'&&((!i)||x[i-1]!='\\')){
			ins=1;ans+=x[i++];
		}
		if(!ins&&!ins2&&x[i]=='\''&&((!i)||x[i-1]!='\\')){
			ins2=1;ans+=x[i++];
		}
		if(ins){
			if(yinhao(i,x,ans)) break;
			continue;
		}
		if(ins2){
			if(yinhao2(i,x,ans)) break;
			continue;
		}
		ans+=x[i];
	}
	return ans;
}
inline bool find(const string& x,const string& s){
	getnxt(s,s,s.size(),s.size(),nxt,1),getnxt(s,x,s.size(),x.size(),d,0);
	string ans="";
	for(int i=0;i<x.size();i++){
		if(inm){continue;}
		if(ins){
			if(yinhao(i,x,ans)) break;
			continue;
		}
		if(ins2){
			if(yinhao2(i,x,ans)) break;
			continue;
		}
		if(d[i]==s.size()){
			if(((!i)||(!in(x[i-1])))&&(i>=x.size()-1||(!in(x[i+s.size()])))&&x[i-1]!='$'){
				return 1;
			}else ans+=x[i];
			continue;
		}
		if(!ins2&&!ins&&x[i]=='"'&&((!i)||x[i-1]!='\\')){ins=1;ans+=x[i++];}
		if(!ins&&!ins2&&x[i]=='\''&&((!i)||x[i-1]!='\\')){ins2=1;ans+=x[i++];}
		if(ins){
			if(yinhao(i,x,ans)) break;
			continue;
		}
		if(ins2){
			if(yinhao2(i,x,ans)) break;
			continue;
		}
		ans+=x[i];
	}
	return 0;
}
//Mode wtf Part
void putleft(int tp,const string& now){
	AllBrackets[BracketsNowpos].inside.push_back(now);
	AllBrackets.push_back(kuohao(tp,BracketsNowpos));
	AllBrackets[BracketsNowpos].chs.push_back(++brackets_CNT);
	BracketsNowpos=brackets_CNT;
}
void putright(int tp,const string& in){
	AllBrackets[BracketsNowpos].inside.push_back(in);
	BracketsNowpos=AllBrackets[BracketsNowpos].fa;
}
inline void findkh(const string& x){
	for(int i=0;i<x.size();i++){
		if(inm) continue;
		if(!ins2&&!ins&&x[i]=='"'&&((!i)||x[i-1]!='\\')) (ins=1),tmp+=x[i++];
		if(!ins2&&!ins&&x[i]=='\''&&((!i)||x[i-1]!='\\')) (ins2=1),tmp+=x[i++];
		if(ins){
			if(yinhao(i,x,tmp)) break;
			continue;
		}
		if(ins2){
			if(yinhao2(i,x,tmp)) break;
			continue;
		}
		char now=x[i];
		if(now=='{'){putleft(0,tmp);tmp="";}
		else if(now=='}'){putright(0,tmp);tmp="";}
		else if(now=='('){putleft(1,tmp);tmp="";}
		else if(now==')'){putright(1,tmp);tmp="";}
		else if(now=='['){putleft(2,tmp);tmp="";}
		else if(now==']'){putright(2,tmp);tmp="";}
		else tmp+=now;
	}tmp+="\n";
}
void prnt(const string& s,int tabs){
	bool zifu=0;
	for(int i=0;i<s.length();i++){
		if(i==0||s[i-1]=='\n'){
			for(int t=1;t<=tabs;t++) cout<<"\t";
		}
		if(zifu||s[i]!=' ') zifu=1,cout<<s[i];
	}
	if(zifu) cout<<"\n";
}
void dfs(int now,int tabs){
	int tp=AllBrackets[now].type;
	if(tp<3){
		for(int t=1;t<tabs;t++) cout<<"\t";
		cout<<"{(["[tp]<<endl;
	}
	auto it1=AllBrackets[now].inside.begin();
	auto it2=AllBrackets[now].chs.begin();
	while(it2!=AllBrackets[now].chs.end()){
		prnt((*it1),tabs);
		dfs(*it2,tabs+1);
		it1++;it2++;
	}
	prnt((*it1),tabs);
	if(tp<3){
		for(int t=1;t<tabs;t++) cout<<"\t";
		cout<<"})]"[tp]<<endl;
	}
}
//Mode mz Part
string tomz(const string& x){
	if(_MODE_CODETYPE!=1) return x;
	string ans;
	for(int i=0;i<x.size();++i){
		ans+=x[i];
		if(x[i+1]=='\n'){
			ans+='\n';
			i++;
			continue;
		}
		ans+="\\\n";
	}
	return ans;
}
//Mode semi Part
void SEMI_init(){
	r=rd()%21+40;
	for(int i=1;i<=r+r;i++) sum+=(f[i]=2*sqrt(r*r-(i-r)*(i-r)));
	for(int i=1;i<r+r;i++) f[i]+=f[i-1];
}
void SEMI_output(){
	for(int i=0;i<a2.length();i++){
		if(a2[i]=='\n') a2[i]=' ';
		if(a2[i]==(char)(2)) cout<<'/';
		else cout<<a2[i];
		if((i==0?0:i%sum?i%sum:sum)==f[fcnt+1]){
			if(a2[i]==(char)(2)) cout<<"/\n";
			else cout<<"\\\n";
			++fcnt;
			if(f[fcnt+1]==0) fcnt=0;
		}
	}
	int tt=a2.length();
	for(int i=(tt==0?0:tt%sum?tt%sum:sum);i<sum;i++){
		cout<<"/";
		if(i==f[fcnt+1]){
			cout<<"/\n";
			++fcnt;
			if(f[fcnt+1]==0) break;
		}
	}
}
void SEMI_to_ok(const string& t){
	if(_MODE_CODETYPE){
		a2+=t;
		return;
	}
	string qian;
	if(nowto&&nowto>f[ffcnt]){
		while(nowto<f[ffcnt+1]) a2+="/",nowto++;
		a2+=(char)(2);ffcnt++;
		if(f[ffcnt+1]==0) ffcnt=0;
	}
	a2+=t;
	nowto=a2.length();
	nowto%=sum;
	while(nowto>=f[ffcnt+1]){
		ffcnt++;
		if(f[ffcnt+1]==0){
			ffcnt=0;
			break;
		}
	}
	while(nowto<f[ffcnt+1]) a2+="/",nowto++;
	a2+=(char)(2);ffcnt++;
	if(f[ffcnt+1]==0) ffcnt=0;
}
//Mode random Part
void random_endl(){
	int cnt=rd()%(_MAX_CHARACTERS_A_LINE-_MIN_CHARACTERS_A_LINE+1)+_MIN_CHARACTERS_A_LINE;
	for(int i=0;i<a2.length();i++){
		if(a2[i]=='\n') a2[i]=' ';
		if(a2[i]==(char)(4)){
			a2[i]='\n';
			cnt=i;
			cnt+=rd()%(_MAX_CHARACTERS_A_LINE-_MIN_CHARACTERS_A_LINE+1)+_MIN_CHARACTERS_A_LINE;
		}
		cout<<a2[i];
		if(i==cnt){
			cout<<"\\\n";
			cnt+=rd()%(_MAX_CHARACTERS_A_LINE-_MIN_CHARACTERS_A_LINE+1)+_MIN_CHARACTERS_A_LINE;
		}
	}
}
//Mode space Part
inline string killspace(const string& x){
	bool jntm=0;
	string ans="";
	for(int i=0;i<x.size();i++){
		if(inm) continue;
		if(ins){
			if(yinhao(i,x,ans)) break;
			continue;
		}
		if(ins2){
			if(yinhao2(i,x,ans)) break;
			continue;
		}
		if(x[i]==' '){
			if(i>0&&cbv(ans[ans.length()-1])&&x[i+1]=='$') ans+=x[i];
			continue;
		}
		if(!ins2&&!ins&&x[i]=='"'&&((!i)||x[i-1]!='\\')){ins=1;ans+=x[i++];}
		if(!ins&&!ins2&&x[i]=='\''&&((!i)||x[i-1]!='\\')){ins2=1;ans+=x[i++];}
		if(ins){
			if(yinhao(i,x,ans)) break;
			continue;
		}
		if(ins2){
			if(yinhao2(i,x,ans)) break;
			continue;
		}
		ans+=x[i];
	}
	return ans;
}
string Change_space(string s){
	if(_MODE_ADDSPACE==0) return s;
	s=killspace(s);
	if(_MODE_ADDSPACE==1) return s;
	string ans="";
	for(int i=0;i<s.size();i++){
		if(inm) continue;
		if(ins){
			if(yinhao(i,s,ans)) break;
			continue;
		}
		if(ins2){
			if(yinhao2(i,s,ans)) break;
			continue;
		}
		if(cbv(s[i])&&i<s.length()-1&&!cbv(s[i+1])||!cbv(s[i])&&i<s.length()-1&&s[i+1]=='$'){
			ans+=s[i];
			if(_MODE_ADDSPACE==2) ans+=" ";
			else if(rd()%2<1) ans+=" ";
			continue;
		}
		if(!ins&&!ins2&&s[i]=='"'&&((!i)||s[i-1]!='\\')){ins=1;ans+=s[i++];}
		if(!ins&&!ins2&&s[i]=='\''&&((!i)||s[i-1]!='\\')){ins2=1;ans+=s[i++];}
		if(ins){
			if(yinhao(i,s,ans)) break;
			continue;
		}
		if(ins2){
			if(yinhao2(i,s,ans)) break;
			continue;
		}
		ans+=s[i];
	}
	return ans;
}
//Main Part
int main(){
	mozhengdig_init();
	SEMI_init();
	DEF_init();
	DEF_out();
	AllBrackets.push_back(kuohao(3,0));
	string t="";
	while(!cin.eof()){
		string tat="\\";
		while(tat[tat.length()-1]=='\\'){t+=tat;t.pop_back();getline(cin,tat);}
		t+=tat;
		bool ls=ins,l2=ins2,lm=inm,rl;
		t=repla(t,"/*","*/",2);rl=inm;ins=ls;ins2=l2;inm=lm;
		t=repla(t,"\t","",1);ins=ls;ins2=l2;inm=lm;
		t=repla(t,"\r","",1);ins=ls;ins2=l2;inm=lm;
		t=repla(t,"\n","",1);ins=ls;ins2=l2;inm=lm;
		t=repla(t,"    ","",1);ins=ls;ins2=l2;inm=lm;
		t=repla(t,"//","/*",1);ins=ls;ins2=l2;inm=lm;
		if(_MODE_CODETYPE==1) t+="\n";
		if(t[0]!='#'){
			for(int i=1;i<=sz;i++)if(!a[i].empty()){
				t=repla(t,a[i],b[i],0);ins=ls;ins2=l2;inm=lm;
			}
			getvars(t);ins=ls;ins2=l2;inm=lm;
			for(auto i:def){
				t=repla(t,i.first,i.second,0);ins=ls;ins2=l2;inm=lm;
			}
			t=repla(t,"1","1",1);if(ins&&t[t.length()-1]!='\\') t+="\\",t+="n";
			ins=ls;ins2=l2;inm=lm;
			t=Change_space(t);ins=ls;ins2=l2;inm=lm;
			a2+=t;
			findkh(t);ins=ls;ins2=l2;inm=lm;
		}
		else{
			findkh(t);ins=ls;ins2=l2;inm=lm;
			if(t[1]=='d'&&t[2]=='e'&&t[3]=='f'&&t[4]=='i'&&t[5]=='n'&&t[6]=='e'){
				string jntm1="";
				int st=8;
				bool isfunc=0;
				while(t[st]!=' '){
					if(t[st]=='('){isfunc=1;break;}
					jntm1+=t[st++];
				}
			}
			if(_MODE_CODETYPE==3) t+=(char)(4);
			SEMI_to_ok(t);
		}
		if(_MODE_CODETYPE==0){
			nowto=a2.length();
			nowto=(nowto==0?0:nowto%sum?nowto%sum:sum);
			if(nowto<f[ffcnt]) ffcnt=0;
			while(nowto>=f[ffcnt+1]) ffcnt++;
			if(f[ffcnt+1]==0) ffcnt=0;
		}
		repla(t,"1","1",1);
		t="";
		inm=rl;
	}putright(3,tmp);
	for(auto i:def) if(i.first!=i.second) aans+="#define "+i.second+" "+i.first+"\n";
	cout<<"// Made By Unreadable Mozheng Code Maker. Thanks for use!"<<endl;
	cout<<tomz(aans)<<endl;
	cout<<tomz(ans)<<endl;
	if(_MODE_CODETYPE==0){SEMI_output();}
	if(_MODE_CODETYPE==1){cout<<tomz(a2)<<endl;}
	if(_MODE_CODETYPE==2){dfs(0,0);}
	if(_MODE_CODETYPE==3){random_endl();}
	fclose(stdin);
	return 0;
}
//Initliazation Part
//for defines
inline void DEF_init(){
	a[++sz]="namespace";b[sz]="AK_SSH";
	a[++sz]="using";b[sz]="HKY";
	a[++sz]="stdin";b[sz]="FUCKIN";
	a[++sz]="stdout";b[sz]="FUCKOUT";
	a[++sz]="string";b[sz]="CHARINFINITY";
	a[++sz]="main";b[sz]="LUOGU_SURVIVE_DEVICE";
	a[++sz]="return";b[sz]="FUCK";
	a[++sz]="void";b[sz]="INT128";
	a[++sz]="cin";b[sz]="SLOWREAD";
	a[++sz]="cout";b[sz]="SLOWWRITE";
	a[++sz]="scanf";b[sz]="FASTREAD";
	a[++sz]="printf";b[sz]="FASTPRINT";
	a[++sz]="struct";b[sz]="BUILDING";
	a[++sz]="bool";b[sz]="BITCHAR";
	a[++sz]="register";b[sz]="FASTER";
	a[++sz]="char";b[sz]="CAO";
	a[++sz]="ans";b[sz]="AWFULISTANS";
	a[++sz]="getchar";b[sz]="getCAO";
	a[++sz]="putchar";b[sz]="putCAO";
	a[++sz]="push_back";b[sz]="POP_back";
	a[++sz]="pop_back";b[sz]="PUSH_back";
	a[++sz]="push";b[sz]="POP";
	a[++sz]="pop";b[sz]="PUSH";
	a[++sz]="continue";b[sz]="BREAK";
	a[++sz]="break";b[sz]="CONTINUE";
	a[++sz]="if";b[sz]="FOR";
	a[++sz]="else";b[sz]="SWITCH";
	a[++sz]="for";b[sz]="IF";
	a[++sz]="\t";b[sz]=" ";dntdef[sz]=1;
	a[++sz]="\n";b[sz]="\n";dntdef[sz]=1;
	a[++sz]="freopen";b[sz]="OPENGRASS";
	a[++sz]="struct";b[sz]="LOWCLASS_T";
	a[++sz]="while";b[sz]="ELSE";
	a[++sz]="endl";b[sz]="\'\\n\'";dntdef[sz]=1;
	a[++sz]="swap";b[sz]="HKYAKSSH";
	a[++sz]="exit";b[sz]="SLOWFUCK";
	a[++sz]="insert";b[sz]="VECTORNB";
	a[++sz]="erase";b[sz]="VECTORLJ";
	a[++sz]="ios";b[sz]="IPHONE";
	a[++sz]="sync_with_stdio";b[sz]="LE_DI_JIA_SU";
	a[++sz]="string";b[sz]="LONGCHAR";
	a[++sz]="inline";b[sz]="OUTLINE";
	a[++sz]="lower_bound";b[sz]="LOWERFIND";
	a[++sz]="upper_bound";b[sz]="UPPERFIND";
	a[++sz]="memset";b[sz]="REAL_SECTION_MODIFY";
	a[++sz]="operator";b[sz]="KLASS";
	a[++sz]="multiset";b[sz]="SETYYDS";
	a[++sz]="const";b[sz]="ALWAYS_CHANGE";
	a[++sz]="init";b[sz]="CTJ";
	a[++sz]="pushup";b[sz]="PUSHNMD";
	a[++sz]="push_up";b[sz]="PUSH_NMD";
	a[++sz]="pushdown";b[sz]="FFFFFKKKKK";
	a[++sz]="push_down";b[sz]="FFFFF_KKKKK";
	a[++sz]="merge";b[sz]="IFTRUE";
	a[++sz]="sqrt";b[sz]="KFYYDS";
	a[++sz]="asin";b[sz]="aCOS_1";
	a[++sz]="sin";b[sz]="COS_1";
	a[++sz]="acos";b[sz]="aSIN_1";
	a[++sz]="cos";b[sz]="SIN_1";
	a[++sz]="fabs";b[sz]="f_CONDITIONAL";
	a[++sz]="abs";b[sz]="CONDITIONAL";
	if(_MODE_RANDOM_STR){a[++sz]="\" \"";b[sz]="\"";b[sz].push_back(2147483648ll);b[sz]+="\"";dntdef[sz++]=1;}
	a[++sz]="modify";b[sz]="FUCKKKKK";
	a[++sz]="query";b[sz]="FFFFFUCK";
	a[++sz]="priority_queue";b[sz++]="MULTISETYYDS";
	a[++sz]="queue";b[sz]="WHY_NOT_TRY_USE_STACK";
	a[++sz]="stack";b[sz]="VECTOR_YYDS";
	a[++sz]="clear";b[sz]="WHILE_1_POP";
	a[++sz]="puts";b[sz]="SLOW_COUT";
	a[++sz]="gets";b[sz]="SLOW_CIN";
	a[++sz]="first";b[sz]="ONEST";
	a[++sz]="second";b[sz]="TWOST";
	a[++sz]="    ";b[sz]=" ";dntdef[sz]=1;
	if(_MODE_XIAHUAXIAN){
		for(int i=0;i<sz;++i){
			if(dntdef[i])continue;
			++varcnt;
			b[i].clear();
			b[i]+="$";
			for(int j=0;j^varcnt;++j)b[i]+="_";
			b[i]+=" ";
		}
	}
}
inline void DEF_out(){
	for(int i=1;i<=sz;i++){
		if(dntdef[i]||a[i].empty())continue;
		if(!_MODE_XIAHUAXIAN){b[i]="$"+rdstr(20)+"__________"+b[i]+"__________"+rdstr(20)+" ";}
		string tmp=string("#define "+b[i])+string(" "+a[i]);
		ans+=/*tomz(tmp)*/tmp+"\n";
	}
}
//for mozheng digit
void chsmin(int l,int r,double val,string now){
    string old=dp[l][r][val];
    if(now.length()<old.length()||old=="") dp[l][r][val]=now;
}
void mozhengdig_init(){
    string ss="114514";
    for(int l=1;l<=6;l++){
        for(int i=1;i<=6;i++){
            int j=i+l-1;
            if(i==j){
                dp[i][j][ss[i-1]^48]=ss[i-1];
            }else{
                for(int k=i;k<j;k++){
                    for(auto x:dp[i][k]){
                        for(auto y:dp[k+1][j]){
                            chsmin(i,j,x.first+y.first,"("+x.second+")+("+y.second+")");
                            chsmin(i,j,x.first-y.first,"("+x.second+")-("+y.second+")");
                            chsmin(i,j,x.first*y.first,"("+x.second+")*("+y.second+")");
                            chsmin(i,j,x.first/y.first,"(double) ("+x.second+")/("+y.second+")");
                            chsmin(i,j,-(x.first+y.first),"-(("+x.second+")+("+y.second+"))");
                            chsmin(i,j,-(x.first-y.first),"-(("+x.second+")-("+y.second+"))");
                            chsmin(i,j,-(x.first*y.first),"-(("+x.second+")*("+y.second+"))");
                            chsmin(i,j,-(x.first/y.first),"-((double) ("+x.second+")/("+y.second+"))");
                        }
                    }
                }
                chsmin(i,j,atoi(ss.substr(i-1,l).c_str()),ss.substr(i-1,l));
                chsmin(i,j,-atoi(ss.substr(i-1,l).c_str()),"-"+ss.substr(i-1,l));
            }
        }
    }
    for(auto i:dp[1][6]) if(i.first==int(i.first)&&i.first>=0){
        brac_s=i.second;
        calc_res="";
        brac_init();
        brac_calc(0,brac_s.length()-1,1,1);
        toecc[(int)i.first]="(double)"+calc_res;
        hasec.insert((int)i.first);
    }
	toecc[229028]="(double)(114514+114514)";
	hasec.insert(229028);
}