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_19230754_12054.cpp:11:2: error: 'LL' does not name a type
  LL; 
  ^
0_0_19230754_12054.cpp:10:11: error: unable to find numeric literal operator 'operator""typedef'
 #define N 200009typedef long long
           ^
0_0_19230754_12054.cpp:14:11: note: in expansion of macro 'N'
 int n,m,a[N],b[N],c[N],L[N],R[N];LL d[N],s1[N],s2[N],sum[N]; LL max(LL aa, LL bb){    if(aa > bb)return aa;    return bb;} 
           ^
0_0_19230754_12054.cpp:10:11: note: use -std=gnu++11 or -fext-numeric-literals to enable more built-in suffixes
 #define N 200009typedef long long
           ^
0_0_19230754_12054.cpp:14:11: note: in expansion of macro 'N'
 int n,m,a[N],b[N],c[N],L[N],R[N];LL d[N],s1[N],s2[N],sum[N]; LL max(LL aa, LL bb){    if(aa > bb)return aa;    return bb;} 
           ^
0_0_19230754_12054.cpp:10:25: error: expected ']' before 'long'
 #define N 200009typedef long long
                         ^
0_0_19230754_12054.cpp:14:11: note: in expansion of macro 'N'
 int n,m,a[N],b[N],c[N],L[N],R[N];LL d[N],s1[N],s2[N],sum[N]; LL max(LL aa, LL bb){    if(aa > bb)return aa;    return bb;} 
           ^
0_0_19230754_12054.cpp:14:34: error: 'LL' does not name a type
 int n,m,a[N],b[N],c[N],L[N],R[N];LL d[N],s1[N],s2[N],sum[N]; LL max(LL aa, LL bb){    if(aa > bb)return aa;    return bb;} 
                                  ^
0_0_19230754_12054.cpp:14:62: error: 'LL' does not name a type
 int n,m,a[N],b[N],c[N],L[N],R[N];LL d[N],s1[N],s2[N],sum[N]; LL max(LL aa, LL bb){    if(aa > bb)return aa;    return bb;} 
                                                              ^
0_0_19230754_12054.cpp: In function 'void make()':
0_0_19230754_12054.cpp:16:78: error: 'a' was not declared in this scope
 int i,j,k,l;    for(i=1;i<=n;i++)    {        k = i-1;        while(k > 0 && a[k] <= a[i])k = b[k];        b[i] = k;    }     for(i=n;i>0;i--)    {        k = i+1;        while(k <= n && a[k] <= a[i])k = c[k];        c[i] = k;    }} 
                                                                              ^
0_0_19230754_12054.cpp:16:95: error: 'b' was not declared in this scope
 int i,j,k,l;    for(i=1;i<=n;i++)    {        k = i-1;        while(k > 0 && a[k] <= a[i])k = b[k];        b[i] = k;    }     for(i=n;i>0;i--)    {        k = i+1;        while(k <= n && a[k] <= a[i])k = c[k];        c[i] = k;    }} 
                                                                                               ^
0_0_19230754_12054.cpp:16:108: error: 'b' was not declared in this scope
 int i,j,k,l;    for(i=1;i<=n;i++)    {        k = i-1;        while(k > 0 && a[k] <= a[i])k = b[k];        b[i] = k;    }     for(i=n;i>0;i--)    {        k = i+1;        while(k <= n && a[k] <= a[i])k = c[k];        c[i] = k;    }} 
                                                                                                            ^
0_0_19230754_12054.cpp:16:188: error: 'a' was not declared in this scope
 int i,j,k,l;    for(i=1;i<=n;i++)    {        k = i-1;        while(k > 0 && a[k] <= a[i])k = b[k];        b[i] = k;    }     for(i=n;i>0;i--)    {        k = i+1;        while(k <= n && a[k] <= a[i])k = c[k];        c[i] = k;    }} 
                                                                                                                                                                                            ^
0_0_19230754_12054.cpp:16:205: error: 'c' was not declared in this scope
 int i,j,k,l;    for(i=1;i<=n;i++)    {        k = i-1;        while(k > 0 && a[k] <= a[i])k = b[k];        b[i] = k;    }     for(i=n;i>0;i--)    {        k = i+1;        while(k <= n && a[k] <= a[i])k = c[k];        c[i] = k;    }} 
                                                                                                                                                                                                             ^
0_0_19230754_12054.cpp:16:218: error: 'c' was not declared in this scope
 int i,j,k,l;    for(i=1;i<=n;i++)    {        k = i-1;        while(k > 0 && a[k] <= a[i])k = b[k];        b[i] = k;    }     for(i=n;i>0;i--)    {        k = i+1;        while(k <= n && a[k] <= a[i])k = c[k];        c[i] = k;    }} 
                                                                                                                                                                                                                          ^
0_0_19230754_12054.cpp: In function 'int main()':
0_0_19230754_12054.cpp:18:104: error: 'sum' was not declared in this scope
 int i,j,k,l,cas=0;    while(scanf("%d %d",&n,&m) != EOF)    {        if(n == 0 && m == 0)break;        sum[0] = 0;        for(i=1;i<=n;i++)        {            scanf("%d",&a[i]);            sum[i] = sum[i-1] + a[i];        }        make();         L[1] = a[1]; for(i=2;i<=n;i++) { L[i] = a[i]; if(L[i] < L[i-1])L[i] = L[i-1]; }        R[n] = a[n]; for(i=n-1;i>0;i--) { R[i] = a[i]; if(R[i] < R[i+1])R[i] = R[i+1]; }         s1[1] = 0;        for(i=2;i<=n;i++)        {            s1[i] = s1[i-1] + max(L[i-1] - a[i], 0);        }        s2[n] = 0;        for(i=n-1;i>0;i--)        {            s2[i] = s2[i+1] + max(R[i+1] - a[i], 0);        }         for(i=1;i<=n;i++)        {            d[i] = 0;            k = b[i];            if(k < 1)d[i] += s1[i];            else            {                l = i-k-1; d[i] += (LL)l*a[i] - (sum[i-1]-sum[k]);             }            k = c[i];            if(k > n)d[i] += s2[i];            else            {                l = k-i-1; d[i] += (LL)l*a[i] - (sum[k-1]-sum[i]);            }        }        sort(d+1, d+1+n);        printf("Case %d: %I64d\n",++cas,d[n-m+1]);    }    return 0;}
                                                                                                        ^
0_0_19230754_12054.cpp:18:173: error: 'a' was not declared in this scope
 int i,j,k,l,cas=0;    while(scanf("%d %d",&n,&m) != EOF)    {        if(n == 0 && m == 0)break;        sum[0] = 0;        for(i=1;i<=n;i++)        {            scanf("%d",&a[i]);            sum[i] = sum[i-1] + a[i];        }        make();         L[1] = a[1]; for(i=2;i<=n;i++) { L[i] = a[i]; if(L[i] < L[i-1])L[i] = L[i-1]; }        R[n] = a[n]; for(i=n-1;i>0;i--) { R[i] = a[i]; if(R[i] < R[i+1])R[i] = R[i+1]; }         s1[1] = 0;        for(i=2;i<=n;i++)        {            s1[i] = s1[i-1] + max(L[i-1] - a[i], 0);        }        s2[n] = 0;        for(i=n-1;i>0;i--)        {            s2[i] = s2[i+1] + max(R[i+1] - a[i], 0);        }         for(i=1;i<=n;i++)        {            d[i] = 0;            k = b[i];            if(k < 1)d[i] += s1[i];            else            {                l = i-k-1; d[i] += (LL)l*a[i] - (sum[i-1]-sum[k]);             }            k = c[i];            if(k > n)d[i] += s2[i];            else            {                l = k-i-1; d[i] += (LL)l*a[i] - (sum[k-1]-sum[i]);            }        }        sort(d+1, d+1+n);        printf("Case %d: %I64d\n",++cas,d[n-m+1]);    }    return 0;}
                                                                                                                                                                             ^
0_0_19230754_12054.cpp:18:249: error: 'L' was not declared in this scope
 int i,j,k,l,cas=0;    while(scanf("%d %d",&n,&m) != EOF)    {        if(n == 0 && m == 0)break;        sum[0] = 0;        for(i=1;i<=n;i++)        {            scanf("%d",&a[i]);            sum[i] = sum[i-1] + a[i];        }        make();         L[1] = a[1]; for(i=2;i<=n;i++) { L[i] = a[i]; if(L[i] < L[i-1])L[i] = L[i-1]; }        R[n] = a[n]; for(i=n-1;i>0;i--) { R[i] = a[i]; if(R[i] < R[i+1])R[i] = R[i+1]; }         s1[1] = 0;        for(i=2;i<=n;i++)        {            s1[i] = s1[i-1] + max(L[i-1] - a[i], 0);        }        s2[n] = 0;        for(i=n-1;i>0;i--)        {            s2[i] = s2[i+1] + max(R[i+1] - a[i], 0);        }         for(i=1;i<=n;i++)        {            d[i] = 0;            k = b[i];            if(k < 1)d[i] += s1[i];            else            {                l = i-k-1; d[i] += (LL)l*a[i] - (sum[i-1]-sum[k]);             }            k = c[i];            if(k > n)d[i] += s2[i];            else            {                l = k-i-1; d[i] += (LL)l*a[i] - (sum[k-1]-sum[i]);            }        }        sort(d+1, d+1+n);        printf("Case %d: %I64d\n",++cas,d[n-m+1]);    }    return 0;}
                                                                                                                                                                                                                                                         ^
0_0_19230754_12054.cpp:18:256: error: 'a' was not declared in this scope
 int i,j,k,l,cas=0;    while(scanf("%d %d",&n,&m) != EOF)    {        if(n == 0 && m == 0)break;        sum[0] = 0;        for(i=1;i<=n;i++)        {            scanf("%d",&a[i]);            sum[i] = sum[i-1] + a[i];        }        make();         L[1] = a[1]; for(i=2;i<=n;i++) { L[i] = a[i]; if(L[i] < L[i-1])L[i] = L[i-1]; }        R[n] = a[n]; for(i=n-1;i>0;i--) { R[i] = a[i]; if(R[i] < R[i+1])R[i] = R[i+1]; }         s1[1] = 0;        for(i=2;i<=n;i++)        {            s1[i] = s1[i-1] + max(L[i-1] - a[i], 0);        }        s2[n] = 0;        for(i=n-1;i>0;i--)        {            s2[i] = s2[i+1] + max(R[i+1] - a[i], 0);        }         for(i=1;i<=n;i++)        {            d[i] = 0;            k = b[i];            if(k < 1)d[i] += s1[i];            else            {                l = i-k-1; d[i] += (LL)l*a[i] - (sum[i-1]-sum[k]);             }            k = c[i];            if(k > n)d[i] += s2[i];            else            {                l = k-i-1; d[i] += (LL)l*a[i] - (sum[k-1]-sum[i]);            }        }        sort(d+1, d+1+n);        printf("Case %d: %I64d\n",++cas,d[n-m+1]);    }    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-11-29 21:22:53, Gzip enabled