please can anyone tell me why this code is WA ???
#include<iostream>
using namespace std;
int main()
{
long long n;
while(cin>>n)
{
long long N;
long long result=0;
long long sum =0;
for(int i=1;i<=n;i++)
{
while(sum<(i*i*i))
{
N=1;
sum+=(N*N*N);
N++;
}
result+=sum;
}
cout ...
Search found 6 matches
- Sat Jun 30, 2012 4:15 am
- Forum: Volume 103 (10300-10399)
- Topic: 10302 - Summation of Polynomials
- Replies: 29
- Views: 18938
- Sat Jun 30, 2012 3:59 am
- Forum: Volume 110 (11000-11099)
- Topic: 11059 - Maximum Product
- Replies: 96
- Views: 51708
Re: 11059 - Maximum Product
are you mean that if i use #include<stdlib.h> i can get AC ???????????????




- Fri Jun 29, 2012 8:05 pm
- Forum: Volume 110 (11000-11099)
- Topic: 11059 - Maximum Product
- Replies: 96
- Views: 51708
Re: 11059 - Maximum Product
tgis is my code and i got every subm compile error not wrong answer ::
plz help
#include<iostream>
using namespace std;
int main()
{
long long int x,y;
int arr[100];
int z=1;
int j=1;
while(cin>>x)
{
int max=-10000000;
if(x==1)
{
cin>>y;
if(y>0)
{
cout<<"Case #"<<j<<": The maximum ...
plz help
#include<iostream>
using namespace std;
int main()
{
long long int x,y;
int arr[100];
int z=1;
int j=1;
while(cin>>x)
{
int max=-10000000;
if(x==1)
{
cin>>y;
if(y>0)
{
cout<<"Case #"<<j<<": The maximum ...
- Sat Apr 28, 2012 10:53 pm
- Forum: Volume 100 (10000-10099)
- Topic: 10038 - Jolly Jumpers
- Replies: 445
- Views: 152646
Re: 10038 - Jolly Jumpers
i can`t understand you .......what must i do to get accepted ????? plz helpbrianfry713 wrote:3sam 3 100 0 1 is Not jolly.

- Sat Apr 28, 2012 5:14 am
- Forum: Volume 100 (10000-10099)
- Topic: 10038 - Jolly Jumpers
- Replies: 445
- Views: 152646
Re: 10038 - Jolly Jumpers
that`s my code and i do`t know why it`s WA always ...plz help me :) :) :)
#include<iostream>
#include<math.h>
using namespace std;
int main()
{
int x[3000],y,dif,flag,i;
int diff[3000];
while(cin>>y)
{
for(int i=0;i<y;i++)
{
cin>>x ;
}
for(int i=0;i<y-1;i++)
{
dif=x -x[i+1];
if(dif<0 ...
#include<iostream>
#include<math.h>
using namespace std;
int main()
{
int x[3000],y,dif,flag,i;
int diff[3000];
while(cin>>y)
{
for(int i=0;i<y;i++)
{
cin>>x ;
}
for(int i=0;i<y-1;i++)
{
dif=x -x[i+1];
if(dif<0 ...
- Mon Apr 09, 2012 8:38 pm
- Forum: Volume 100 (10000-10099)
- Topic: 10038 - Jolly Jumpers
- Replies: 445
- Views: 152646
Re: 10038 - Jolly Jumpers
i can`t get AC .....and don`t know why ????
this my code ::
#include<iostream>
#include<algorithm>
using namespace std;
int main()
{
int arr[3000];
int n,result;
while(cin>>n)
{
for(int i=0;i<n;i++)
{
cin>>arr ;
}
sort(arr,arr+n);
for(int i=2;i<=n;i++)
{
result=arr[n-1]-arr[n-i];
}
if ...
this my code ::
#include<iostream>
#include<algorithm>
using namespace std;
int main()
{
int arr[3000];
int n,result;
while(cin>>n)
{
for(int i=0;i<n;i++)
{
cin>>arr ;
}
sort(arr,arr+n);
for(int i=2;i<=n;i++)
{
result=arr[n-1]-arr[n-i];
}
if ...