/ Vijos /

记录详情

Compile Error

foo.cpp:4:18: error: stray '#' in program
 #define sf scanf #define pf printf 
                  ^
foo.cpp:17:3: note: in expansion of macro 'sf'
 { sf("%d%lf",&N,&E); lp(i,1,N)sf("%lf%lf%lf",&S[i],&K[i],&Vw[i]); double l=0,r=1; while(calc(r,1)>E)l=r,r*=2; while(r-l>1e-12){ if(calc((l+r)/2,1)>E)l=(l+r)/2; else r=(l+r)/2; } 
   ^
foo.cpp:4:18: error: stray '#' in program
 #define sf scanf #define pf printf 
                  ^
foo.cpp:17:31: note: in expansion of macro 'sf'
 { sf("%d%lf",&N,&E); lp(i,1,N)sf("%lf%lf%lf",&S[i],&K[i],&Vw[i]); double l=0,r=1; while(calc(r,1)>E)l=r,r*=2; while(r-l>1e-12){ if(calc((l+r)/2,1)>E)l=(l+r)/2; else r=(l+r)/2; } 
                               ^
foo.cpp:7:1: error: expected unqualified-id before 'for'
 for(int i=a;i<=b;++i) using namespace std; 
 ^
foo.cpp:7:13: error: 'i' does not name a type
 for(int i=a;i<=b;++i) using namespace std; 
             ^
foo.cpp:7:18: error: expected unqualified-id before '++' token
 for(int i=a;i<=b;++i) using namespace std; 
                  ^
foo.cpp: In function 'double calc(double, int)':
foo.cpp:12:29: error: 'i' was not declared in this scope
 lp(i,1,N){ double t=(max(Vw[i]/3.0*2,0.0)+1)*5,u; 
                             ^
foo.cpp:12:41: error: 'max' was not declared in this scope
 lp(i,1,N){ double t=(max(Vw[i]/3.0*2,0.0)+1)*5,u; 
                                         ^
foo.cpp:12:41: note: suggested alternative:
In file included from c:\tdm-gcc-32\lib\gcc\mingw32\4.8.1\include\c++\algorithm:61:0,
                 from foo.cpp:2:
c:\tdm-gcc-32\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_algobase.h:260:5: note:   'std::max'
     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
     ^
foo.cpp:13:13: error: 'u' was not declared in this scope
 while(myabs(u=(2*phi*K[i]*t*t*t-2*phi*K[i]*Vw[i]*t*t-1))>1e-12) 
             ^
foo.cpp: In function 'int main()':
foo.cpp:4:19: error: expected ';' before 'define'
 #define sf scanf #define pf printf 
                   ^
foo.cpp:17:3: note: in expansion of macro 'sf'
 { sf("%d%lf",&N,&E); lp(i,1,N)sf("%lf%lf%lf",&S[i],&K[i],&Vw[i]); double l=0,r=1; while(calc(r,1)>E)l=r,r*=2; while(r-l>1e-12){ if(calc((l+r)/2,1)>E)l=(l+r)/2; else r=(l+r)/2; } 
   ^
foo.cpp:17:20: warning: statement is a reference, not call, to function 'scanf' [-Waddress]
 { sf("%d%lf",&N,&E); lp(i,1,N)sf("%lf%lf%lf",&S[i],&K[i],&Vw[i]); double l=0,r=1; while(calc(r,1)>E)l=r,r*=2; while(r-l>1e-12){ if(calc((l+r)/2,1)>E)l=(l+r)/2; else r=(l+r)/2; } 
                    ^
foo.cpp:17:20: warning: statement has no effect [-Wunused-value]
foo.cpp:4:19: error: expected ';' before 'define'
 #define sf scanf #define pf printf 
                   ^
foo.cpp:17:31: note: in expansion of macro 'sf'
 { sf("%d%lf",&N,&E); lp(i,1,N)sf("%lf%lf%lf",&S[i],&K[i],&Vw[i]); double l=0,r=1; while(calc(r,1)>E)l=r,r*=2; while(r-l>1e-12){ if(calc((l+r)/2,1)>E)l=(l+r)/2; else r=(l+r)/2; } 
                               ^
foo.cpp:17:65: warning: statement is a reference, not call, to function 'scanf' [-Waddress]
 { sf("%d%lf",&N,&E); lp(i,1,N)sf("%lf%lf%lf",&S[i],&K[i],&Vw[i]); double l=0,r=1; while(calc(r,1)>E)l=r,r*=2; while(r-l>1e-12){ if(calc((l+r)/2,1)>E)l=(l+r)/2; else r=(l+r)/2; } 
                                                                 ^
foo.cpp:17:65: warning: statement has no effect [-Wunused-value]
foo.cpp:18:24: error: 'pf' was not declared in this scope
 pf("%.12lf\n",calc(l,0)); //ps; return 0; }
                        ^
foo.cpp:18:25: error: expected '}' at end of input
 pf("%.12lf\n",calc(l,0)); //ps; return 0; }
                         ^

信息

递交者
类型
递交
题目
P1805 骑行川藏
语言
C++
递交时间
2014-09-28 19:52:37
评测时间
2014-09-28 19:52:37
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes