F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

View Compilation Error

0_0_19230758_146.cpp: In function 'int main()':
0_0_19230758_146.cpp:28:186: error: 's' was not declared in this scope
 int cc=1;    while(scanf("%d",&n)!=EOF)    {        if(n == 0)            break;        lld sum=0;        bool zero=true;        for(int i=0;i<n;i++)        {            scanf("%I64d",&s[i]);            s[i+n]=s[i];            sum+=s[i];            if(s[i] != 0)                zero=false;        }        if(sum < 0)        {            printf("Case %d: -1\n",cc++);            continue;        }        if(sum == 0 && !zero)        {            printf("Case %d: -1\n",cc++);            continue;        }        lld ans=0;        for(int i=0;i<n;i++)        {            lld now=0;            for(int j=0;j<n;j++)            {                now+=s[i+j];                if(now < 0)                {                    lld x=-now/sum;                    if(x*sum != -now)                        x++;                    ans+=x;                }            }        }        printf("Case %d: %I64d\n",cc++,ans);    }    return 0;}
                                                                                                                                                                                          ^
0_0_19230758_146.cpp:28:650: error: 's' was not declared in this scope
 int cc=1;    while(scanf("%d",&n)!=EOF)    {        if(n == 0)            break;        lld sum=0;        bool zero=true;        for(int i=0;i<n;i++)        {            scanf("%I64d",&s[i]);            s[i+n]=s[i];            sum+=s[i];            if(s[i] != 0)                zero=false;        }        if(sum < 0)        {            printf("Case %d: -1\n",cc++);            continue;        }        if(sum == 0 && !zero)        {            printf("Case %d: -1\n",cc++);            continue;        }        lld ans=0;        for(int i=0;i<n;i++)        {            lld now=0;            for(int j=0;j<n;j++)            {                now+=s[i+j];                if(now < 0)                {                    lld x=-now/sum;                    if(x*sum != -now)                        x++;                    ans+=x;                }            }        }        printf("Case %d: %I64d\n",cc++,ans);    }    return 0;}
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          ^


Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-12-24 00:44:50, Gzip enabled