ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1079. Maximum

What's the mistake?(Compilation Error)?
Posted by Taloi Bogdan 5 Oct 2007 22:15
I am a beginner in C++, but I made it in Pascal for AC.
Please help me to find the mistake!

#include<iostream.h>
int huge c[100001];
void main()
{long a[15],n=0,m=0,mm,i,j;
do{n++;cin>>a[n];if(a[n]>m)m=a[n];}while(a[n]);
n--;
c[0]=0;
c[1]=1;
for(i=2;i<=m;i++){if(i%2==0)c[i]=c[i/2];
              else c[i]=c[i/2]+c[i/2+1];}
for(i=1;i<=n;i++){mm=0;for(j=1;j<=a[i];j++)if(mm<c[j])mm=c[j];cout<<mm<<endl;}

    }
Re: What's the mistake?(Compilation Error)?
Posted by CHIDEMYAN SERGEY 5 Oct 2007 22:21
Just erase "huge" in follow line:
int huge c[100001];
There is no such type on C++.