Please subscribe to the official Codeforces channel in Telegram via the link https://t.me/codeforces_official. ×

Akramjon's blog

By Akramjon, 13 years ago, In English
Can anybody  find my mistake at this -> http://www.e-olimp.com/problems/477 problem??
My code:
#include <stdio.h>
#include <vector>
#include <algorithm>
using namespace std;
vector<int>v;
int n,i,j;
main ()
     {
     scanf ("%d",&n);
     for (i=0;i*i*i<=n;i++)
         v.push_back(i);
     for (i=0;i<v.size();i++)
         for (j=i;j<v.size();j++)
             if (v[i]*v[i]*v[i]+v[j]*v[j]*v[j]==n)
                {printf ("%d %d\n",v[i],v[j]);break;}
     return 0;
     }

  • Vote: I like it
  • -23
  • Vote: I do not like it

13 years ago, # |
  Vote: I like it +1 Vote: I do not like it
Read the problem's statement once more. It'll help
13 years ago, # |
  Vote: I like it 0 Vote: I do not like it
Check the possible values of answers.