AK360 @ 2024-08-11 20:37:51
#include<bits/stdc++.h>
using namespace std;
bool h(int n)
{
if(n<=9)
{
return 1;
}
int y=0;
int x=n;
while(x>0)
{
y=y*10+x%10;
x=x/10;
}
if(y==n)
{
return 1;
}
return 0;
}
long long q(int n)
{
if(n<=9)
{
return n;
}
int x=n,y=0;
while(x>0)
{
y=y*10+x%10;
x/=10;
}
return y;
}
int main ()
{
int m,n=0;
string s;
cin>>m;
if(m==10)
{
cin>>n;
}
else if(m==2)
{
cin>>s;
for(int i=0;i<s.size();i++)
{
n=n+s[i]*pow(2,i);
}
}
// if(h(n))
// {
// cout<<n;
// }
int d=0;
while(d<=30)
{
d++;
n+=q(n);
if(h(n))
{
cout<<"STEP="<<d;
return 0;
}
}
cout<<"Impossible!";
return 0;
}
by hanxiaofensheng @ 2024-08-11 20:50:14
你这是全wa了吗?
by AK360 @ 2024-08-11 20:50:59
@xiaokeai1234 对
by hanxiaofensheng @ 2024-08-11 20:51:26
只需要让程序输出"Impossible!"即可
by hanxiaofensheng @ 2024-08-11 20:51:42
这样可以骗点分
by hanxiaofensheng @ 2024-08-11 20:52:18
我说的只要是0分
by AK360 @ 2024-08-11 20:53:53
@xiaokeai1234 ok
by hanxiaofensheng @ 2024-08-11 20:58:27
25分
by kanqiqin @ 2024-08-13 15:57:10
666