全WA求助,玄关
查看原帖
全WA求助,玄关
749062
zhuo_c_da楼主2024/5/4 19:45

rt

#include<bits/stdc++.h>
using namespace std;
char a[1000001];
long long b[1000010];
long long n=0;
void str(char c)
{
	if(c=='A') b[n+=1]=10;
	else if(c=='B') b[n+=1]=11;
	else if(c=='C') b[n+=1]=12;
	else if(c=='D') b[n+=1]=13;
	else if(c=='E') b[n+=1]=14;
	else if(c=='F') b[n+=1]=15;
	else if(c=='G') b[n+=1]=16;
	else if(c=='H') b[n+=1]=17;
	else if(c=='I') b[n+=1]=18;
	else if(c=='J') b[n+=1]=19;
	else if(c=='K') b[n+=1]=20;
	else if(c=='L') b[n+=1]=21;
	else if(c=='M') b[n+=1]=22;
	else if(c=='N') b[n+=1]=23;
	else if(c=='O') b[n+=1]=24;
	else if(c=='P') b[n+=1]=25;
	else if(c=='Q') b[n+=1]=26;
	else if(c=='R') b[n+=1]=27;
	else if(c=='S') b[n+=1]=28;
	else if(c=='T') b[n+=1]=29;
	else if(c=='U') b[n+=1]=30;
	else if(c=='V') b[n+=1]=31;
	else if(c=='W') b[n+=1]=32;
	else if(c=='X') b[n+=1]=33;
	else if(c=='Y') b[n+=1]=34;
	else if(c=='Z') b[n+=1]=35;
	else b[n+=1]=1ll*(a[n-1]-'0');
}
int main()
{
	long long x,s=0;
	cin>>x>>a;
	for(long long i=0;i<strlen(a);i++)
	{
		str(a[i]);
	}
	for(long long i=1;i<=n;i++)
	{
		s+=b[i]*pow(x,n-i);
	}
	cout<<s;
	return 0;
}
2024/5/4 19:45
加载中...