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 1025. Democracy in Danger

why is the ""compiling error""?
Posted by tnvkrishna 7 Oct 2007 21:55
#include <iostream>
using namespace std;
int main()
{
bool t;
int n,nn;
cin>>n;
short a[n];
for(int i=0;i<n;i++)
{
t=true;
cin>>nn;
if((i-1>=0&&a[i-1]<=nn)||(i==0))
a[i]=nn;
else
for(int j=0;j<i;j++)
{
if(a[j]>nn)
{
for(int jj=i;jj>j;jj--)
a[jj]=a[jj-1];
a[j]=nn;
t=false;
}
if(!t)break;
}
}
int c=0;
for(int i=0;i<(n/2)+1;i++)
c+=a[i]/2+1;
cout<<c;
}

compiling error??

Edited by author 07.10.2007 21:56
Re: why is the ""compiling error""?
Posted by Rockman 21 Apr 2009 14:24
[code deleted]

Edited by moderator 20.11.2019 00:23
Re: why is the ""compiling error""?
Posted by Rockman 21 Apr 2009 14:25
AC!you must create your array with another way