Help Lazy Tareq!!

There is a boy named Tareq Abrar who is very lazy. He likes sleeping. He also likes eating. His moth…

Click here to read the complete problem statement.


If you need help solving this problem, mention your approach and ask specific questions. Please avoid sharing your code and asking the Community to figure out “what’s wrong”.

Is the dataset or constraint correct? In the input section, it is said that: 1 ≤ X ≤ 1017.
But “assert(1 <= x && x <= (long long)1e17);” fails if this line is added to my c++ solution.
Here is my code: xv2UfV - Online C++0x Compiler & Debugging Tool - Ideone.com . Assert is on the 63rd line.

1 Like

There was an issue with the dataset. The correct constraint is 0 ≤ X ≤ 1017.

Thank you for reporting this.

You’re most welcome.

1 Like

def gcd(num):

i=1

j=[]

k=0

while i<=num/3:

  if num%i==0 and i%2==0:

     j.append(i)

  i+=1

j.append(num)

j.append(num/2)

for number in j:

  k=k+int(number)

return k

i,p=input().split()

t=int(i)*pow(10,int(p))

print(gcd(t))
what is wrong with this it shows runtime error