/ Vijos /

记录详情

Compile Error

foo.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
 include<iostream> include<cstdio>
        ^
foo.c: In function 'main':
foo.c:5:1: warning: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
 scanf("%d",&n);
 ^
foo.c:5:1: warning: incompatible implicit declaration of built-in function 'scanf' [enabled by default]
foo.c:5:13: error: 'n' undeclared (first use in this function)
 scanf("%d",&n);
             ^
foo.c:5:13: note: each undeclared identifier is reported only once for each function it appears in
foo.c:6:1: error: 'for' loop initial declarations are only allowed in C99 mode
 for(int i=1;i<=n;++i)
 ^
foo.c:6:1: note: use option -std=c99 or -std=gnu99 to compile your code
foo.c:7:13: error: 'h' undeclared (first use in this function)
 scanf("%d",&h[i]);
             ^
foo.c:8:1: error: 'f' undeclared (first use in this function)
 f[1]=h[1];left[1]=1;len=1;
 ^
foo.c:8:11: error: 'left' undeclared (first use in this function)
 f[1]=h[1];left[1]=1;len=1;
           ^
foo.c:8:21: error: 'len' undeclared (first use in this function)
 f[1]=h[1];left[1]=1;len=1;
                     ^
foo.c:9:9: error: redefinition of 'i'
 for(int i=2;i<=n;++i)
         ^
foo.c:6:9: note: previous definition of 'i' was here
 for(int i=1;i<=n;++i)
         ^
foo.c:9:1: error: 'for' loop initial declarations are only allowed in C99 mode
 for(int i=2;i<=n;++i)
 ^
foo.c:11:5: error: 't' undeclared (first use in this function)
 for(t=0,l=1,r=len,mid=(l+r)>>1;l<=r;mid=(l+r)>>1)
     ^
foo.c:11:9: error: 'l' undeclared (first use in this function)
 for(t=0,l=1,r=len,mid=(l+r)>>1;l<=r;mid=(l+r)>>1)
         ^
foo.c:11:8: warning: left-hand operand of comma expression has no effect [-Wunused-value]
 for(t=0,l=1,r=len,mid=(l+r)>>1;l<=r;mid=(l+r)>>1)
        ^
foo.c:11:13: error: 'r' undeclared (first use in this function)
 for(t=0,l=1,r=len,mid=(l+r)>>1;l<=r;mid=(l+r)>>1)
             ^
foo.c:11:12: warning: left-hand operand of comma expression has no effect [-Wunused-value]
 for(t=0,l=1,r=len,mid=(l+r)>>1;l<=r;mid=(l+r)>>1)
            ^
foo.c:11:19: error: 'mid' undeclared (first use in this function)
 for(t=0,l=1,r=len,mid=(l+r)>>1;l<=r;mid=(l+r)>>1)
                   ^
foo.c:11:18: warning: left-hand operand of comma expression has no effect [-Wunused-value]
 for(t=0,l=1,r=len,mid=(l+r)>>1;l<=r;mid=(l+r)>>1)
                  ^
foo.c:12:24: warning: left-hand operand of comma expression has no effect [-Wunused-value]
 if(f[mid]<h[i]) l=mid+1,t=mid;else r=mid-1; if(++t>len) f[++len]=h[i];
                        ^
foo.c:16:11: error: 'right' undeclared (first use in this function)
 f[1]=h[n];right[n]=1;len=1;
           ^
foo.c:17:9: error: redefinition of 'i'
 for(int i=n-1;i;--i)
         ^
foo.c:9:9: note: previous definition of 'i' was here
 for(int i=2;i<=n;++i)
         ^
foo.c:17:1: error: 'for' loop initial declarations are only allowed in C99 mode
 for(int i=n-1;i;--i)
 ^
foo.c:19:8: warning: left-hand operand of comma expression has no effect [-Wunused-value]
 for(t=0,l=1,r=len,mid=(l+r)>>1;l<=r;mid=(l+r)>>1)
        ^
foo.c:19:12: warning: left-hand operand of comma expression has no effect [-Wunused-value]
 for(t=0,l=1,r=len,mid=(l+r)>>1;l<=r;mid=(l+r)>>1)
            ^
foo.c:19:18: warning: left-hand operand of comma expression has no effect [-Wunused-value]
 for(t=0,l=1,r=len,mid=(l+r)>>1;l<=r;mid=(l+r)>>1)
                  ^
foo.c:20:24: warning: left-hand operand of comma expression has no effect [-Wunused-value]
 if(f[mid]<h[i]) l=mid+1,t=mid;else r=mid-1; if(++t>len) f[++len]=h[i];
                        ^
foo.c:24:9: error: redefinition of 'i'
 for(int i=2;i<=n;++i)
         ^
foo.c:17:9: note: previous definition of 'i' was here
 for(int i=n-1;i;--i)
         ^
foo.c:24:1: error: 'for' loop initial declarations are only allowed in C99 mode
 for(int i=2;i<=n;++i)
 ^
foo.c:25:1: error: 'ans' undeclared (first use in this function)
 ans=std::max(ans,left[i-1]+right[i]);
 ^

信息

递交者
类型
递交
题目
P1098 合唱队形
语言
C
递交时间
2016-05-19 16:35:51
评测时间
2016-05-19 16:35:51
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes