记录编号 551167 评测结果 AAAAA
题目名称 林荫的恶意 最终得分 100
用户昵称 Gravatar瑆の時間~無盡輪迴·林蔭 是否通过 通过
代码语言 C++ 运行时间 0.003 s
提交时间 2020-04-22 00:33:49 内存使用 14.13 MiB
显示代码纯文本
#include<iostream>
#include<cstdio> 
#include<algorithm>
using namespace std;
int vis[10001],pri[10001],V[100001],A[11];
int n,cnt,jl,sd;
struct PE
{
	string p; 
};
PE list[1001];
string M;
int Flag;
void DFS(int I)
{
	if(I==M.size()-1)
	{
		Flag=1;
		return ;
	}
	for(int i=0;i<=117;i++)
	{
		if(list[i].p.size()==1)
		{
			if(list[i].p[0]==M[I+1])
			{
				DFS(I+1);
			}
		}
		else
		{
			if(list[i].p[1]==M[I+2]&&list[i].p[0]==M[I+1])
				DFS(I+2);
		}
	}
}
void Euler()
{
	vis[1]=1;
	for(int i=2;i<=10000;i++)
	{
		if(!vis[i])
		{
			pri[++cnt]=i;
		}
		for(int j=1;j<=cnt;j++)
		{
			if(pri[j]*i>10000)
			{
				break;
			}
			vis[pri[j]*i]=1;
		}
	}
}
int main()
{
	freopen("LINYINSEVIL.in","r",stdin);
	freopen("LINYINSEVIL.out","w",stdout);
	cin>>sd;
	Euler();
	for(int i=1;i<=cnt;i++)
	{
		if(sd%pri[i]==0&&vis[sd/pri[i]]==0)
		{
			cout<<pri[i]<<sd/pri[i]<<endl;
			break; 
		}
	}
	int v;
	cin>>v;
	n=6;
	while(v)
	{
		if(v&1)
		{
			A[n]=1;
		}
		n--;
		v>>=1;
	}
	int ans=0;
	ans+=A[1]*32;
	ans+=A[6]*16;
	ans+=A[4]*8;
	ans+=A[3]*4;
	ans+=A[5]*2;
	ans+=A[2]*1;
	cout<<ans<<endl;
	list[0].p = "H";
	list[1].p = "HE";
	list[2].p = "LI";
	list[3].p = "BE";
	list[4].p = "B";
	list[5].p = "C";
	list[6].p = "N";
	list[7].p = "O";
	list[8].p = "F";
	list[9].p = "NE";
	list[10].p = "NA";
	list[11].p = "MG";
	list[12].p = "AL";
	list[13].p = "SI";
	list[14].p = "P";
	list[15].p = "S";
	list[16].p = "CL";
	list[17].p = "AR";
	list[18].p = "K";
	list[19].p = "CA";
	list[20].p = "SC";
	list[21].p = "TI";
	list[22].p = "V";
	list[23].p = "CR";
	list[24].p = "MN";
	list[25].p = "FE";
	list[26].p = "CO";
	list[27].p = "NI";
	list[28].p = "CU";
	list[29].p = "ZN";
	list[30].p = "GA";
	list[31].p = "GE";
	list[32].p = "AS";
	list[33].p = "SE";
	list[34].p = "BR";
	list[35].p = "KR";
	list[36].p = "RB";
	list[37].p = "SR";
	list[38].p = "Y";
	list[39].p = "ZR";
	list[40].p = "NB";
	list[41].p = "MO";
	list[42].p = "TC";
	list[43].p = "RU";
	list[44].p = "RH";
	list[45].p = "PD";
	list[46].p = "AG";
	list[47].p = "CD";
	list[48].p = "IN";
	list[49].p = "SN";
	list[50].p = "SB";
	list[51].p = "TE";
	list[52].p = "I";
	list[53].p = "XE";
	list[54].p = "CS";
	list[55].p = "BA";
	list[56].p = "LA";
	list[57].p = "CE";
	list[58].p = "PR";
	list[59].p = "ND";
	list[60].p = "PM";
	list[61].p = "SM";
	list[62].p = "EU";
	list[63].p = "GD";
	list[64].p = "TB";
	list[65].p = "DY";
	list[66].p = "HO";
	list[67].p = "ER";
	list[68].p = "TM";
	list[69].p = "YB";
	list[70].p = "LU";
	list[71].p = "HF";
	list[72].p = "TA";
	list[73].p = "W";
	list[74].p = "RE";
	list[75].p = "OS";
	list[76].p = "IR";
	list[77].p = "PT";
	list[78].p = "AU";
	list[79].p = "HG";
	list[80].p = "TL";
	list[81].p = "PB";
	list[82].p = "BI";
	list[83].p = "PO";
	list[84].p = "AT";
	list[85].p = "RN";
	list[86].p = "FR";
	list[87].p = "RA";
	list[88].p = "AC";
	list[89].p = "TH";
	list[90].p = "PA";
	list[91].p = "U";
	list[92].p = "NP";
	list[93].p = "PU";
	list[94].p = "AM";
	list[95].p = "CM";
	list[96].p = "BK";
	list[97].p = "CF";
	list[98].p = "ES";
	list[99].p = "FM";
	list[100].p = "MD";
	list[101].p = "NO";
	list[102].p = "LR";
	list[103].p = "RF";
	list[104].p = "DB";
	list[105].p = "SG";
	list[106].p = "BH";
	list[107].p = "HS";
	list[108].p = "MT";
	list[109].p = "DS";
	list[110].p = "RG";
	list[111].p = "CN";
	list[112].p = "NH";
	list[113].p = "FL";
	list[114].p = "MC";
	list[115].p = "LV";
	list[116].p = "TS";
	list[117].p = "OG";
	cin>>M;
	DFS(-1);
	if(Flag==1)
	{
		cout<<"YES"<<endl;
	}
	else
		cout<<"NO"<<endl;
	return 0;
}