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_22048212_26777.cpp: In function 'int main()':
0_0_22048212_26777.cpp:3:564: error: expected '}' at end of input
 const int maxn = 1000005;int n;int a[2*maxn];int b[maxn];int g[2*maxn];int getint() {    char c = getchar();    if(c == EOF)        return -1;    int x = 0;    while(c != ' ' && c != '\n') {        x = c - '0' + x*10;        c = getchar();    }    return x;}void in() {    for(int i = 1; i <= n; i++)        a[i] = getint();    for(int i = n+1; i <= 2*n; i++)        a[i] = a[i-n];    for(int i = 1; i <= n; i++)        b[i] = getint();    for(int i = 1; i <= n; i++)        g[i] = a[i] - b[i];    for(int i = n+1; i <= 2*n; i++)        g[i] = g[i-n];}int main() {//    freopen("in.txt", "r", stdin);    while(true) {        n = getint();        if(n == -1)            break;        in();        int i = 1, j = 1, sum = 0, card = 0, ans = 0;        while(i <= n && j <= 2*n) {            int t = 0;            while((j-i+1) <= n && sum >= 0){                sum += g[j];                t += a[j++];            }            if(t > card){                ans = i-1;                card = t;            }            sum -= g[i];            t -= a[i++];        }        printf("%d\n", 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-06-17 11:04:20, Gzip enabled