Algorithm of 11428 - Cubes

Problem Description Link
Algorithm:

Given a positive integer N you will have to find two positive integers x and y such that:


This is a simple problem. You can just follow this technique
for this problem solution you need two loop
first loop(i) start from cubic root of N  and to sqrt of N
second loop(j) start from 1 to i
and check (i*i*i)-(j*j*j) =N or not
if equal then print i and j

No comments:

Post a Comment

Write your comment - Share Knowledge and Experience