Hanabi_BNUAZ @ 2021-04-06 21:16:23
#include<bits/stdc++.h>
using namespace std;
char s[1005];
int number[10],l;
inline int min(int a,int b) { return a<b?a:b; }
inline int num(int i)
{
switch (s[i])
{
case 'a':
if ((s[i+1]==' ') || (s[i+2]=='o')) return 1;
else return 0;
case 'b':
if (s[i+1]=='o') return 2;
else return 0;
case 'e':
if ((s[i+1]=='i') && (s[min(l-1,i+5)]=='e')) return 18;
else if (s[i+1]=='i') return 8;
else if (s[i+1]=='l') return 11;
else return 0;
case 'f':
if (s[i+2]=='r') return 1;
else if ((s[i+1]=='o') && (s[min(l-1,i+4)]=='t')) return 14;
else if (s[i+1]=='o') return 4;
else if (s[min(l-1,i+3)]=='t') return 15;
else if (s[i+2]=='v') return 5;
else return 0;
case 'n':
if (s[min(l-1,i+4)]=='t') return 19;
else if (s[i+2]=='i') return 9;
else return 0;
case 'o':
if (s[i+1]=='n') return 1;
else return 0;
case 's':
if ((s[i+1]=='e') && (s[min(l-1,i+5)]=='t')) return 17;
else if (s[i+2]=='c') return 2;
else if (s[i+1]=='e') return 7;
else if ((s[i+1]=='i') && (s[min(l-1,i+3)]=='t')) return 16;
else if (s[i+2]=='x') return 6;
else return 0;
case 't':
if (s[i+2]=='n') return 10;
else if (s[min(i+4,l-1)]=='d') return 3;
else if (s[i+2]=='i') return 13;
else if (s[i+2]=='r') return 3;
else if (s[i+2]=='o') return 2;
else if (s[i+4]=='v') return 12;
else if (s[i+1]=='w') return 20;
else if (s[i+3]=='e') return 3;
else return 0;
default:
return 0;
}
}
int main()
{
int sum=0,flag=0;
gets(s);
for (int i=strlen(s);i;--i)
s[i]=s[i-1];
s[0]=' ';
s[1]=tolower(s[1]);
l=strlen(s);
for (int i=0;i<=l-1;++i) if (s[i]==' ') number[sum++]=(int)(num(i+1)*num(i+1))%100;
sort(number,number+sum);
for (int i=0;i<sum;++i)
if (number[i])
{
if ((number[i]<10) && (flag)) printf("0");
flag=1;
printf("%d",number[i]);
}
if (!(flag)) printf("0\n");
return 0;
}
input:
Worcher's data terrors me a lot.
theoretical output:
1
actual output:
109
by duyi @ 2021-04-06 21:17:57
论您到底有多强!%%%%%%
by yzhang @ 2021-04-06 21:18:18
论您到底有多强!%%%%%%
by 眷梦之宇 @ 2021-04-06 21:45:17
眼神呆滞的我看着两位红名带钩大佬讨论一道黄题
by expect @ 2021-04-06 22:08:54
论您到底有多强!%%%%%%