We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
int ff(long long int a)
{
int c=0;
while (a>0)
{
a=a/10;
c=c+1;
}
return c;
}
long long int gg(long long int a)
{
long long int p,q,s;
q=ff(a);
p=a%10;
a=a/10;
s=pow(10,q-1)*p+a;
return s;
}
int main()
{
long long int i,j,k,s=0;
long long int n;
scanf("%lld",&n);
for (i=11;ik)
break;
}
}
printf("%lld",s);
}
2}
def dov(a):
p=str(a)
q=p[len(p)-1]
r=p[0:len(p)-1]
s=q+r;
return int(s)
a=int(input())
s=0
for x in range(11,10**a):
p=dov(x)
for y in range(1,10):
if (p==x*y):
s=s+x
elif x*y>p:
break
print(s)
can anyone tell me why both process terminated
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Project Euler #168: Number Rotations
You are viewing a single comment's thread. Return to all comments →
1}
include
include
int ff(long long int a) { int c=0; while (a>0) { a=a/10; c=c+1; } return c; } long long int gg(long long int a) { long long int p,q,s; q=ff(a); p=a%10; a=a/10; s=pow(10,q-1)*p+a; return s; } int main() { long long int i,j,k,s=0; long long int n; scanf("%lld",&n); for (i=11;ik) break; } } printf("%lld",s); }
2}
def dov(a): p=str(a) q=p[len(p)-1] r=p[0:len(p)-1] s=q+r; return int(s) a=int(input()) s=0 for x in range(11,10**a): p=dov(x) for y in range(1,10): if (p==x*y): s=s+x elif x*y>p: break
print(s)
can anyone tell me why both process terminated