/ Vijos /

记录详情

Compile Error

foo.cpp:1:1: error: 'include' does not name a type
 include<stdio.h>
 ^
foo.cpp: In function 'void paixu()':
foo.cpp:9:90: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
  long i,j; double t; for (i=1;i<m;i++) for (j=i+1;j<=m;j++) if ((a[i]>a[j])||(a[i]==a[j])&&(b[i]>b[j])) { t=a[i];a[i]=a[j];a[j]=t; t=b[i];b[i]=b[j];b[j]=t; } }
                                                                                          ^
foo.cpp: In function 'int main()':
foo.cpp:15:30: error: 'scanf' was not declared in this scope
  scanf("%ld %ld %ld",&n,&p,&m); for (i=1;i<=m;i++) { scanf("%lf%lf",&a[i],&b[i]); b[i]+=a[i]; } paixu(); ans=1;time=0;k=1;go=false; while (ans<n) { while ((a[k]-time<1)&&(k<=m)) { if (b[k]>time) time=b[k]; k++; } if (k>m) { go=true; break; } t=long(a[k]-time); while (t>0) { time=time+1; ans+=min(p,ans); t--; if (ans>n) break; } if (ans>n) break; } if (go) { while (ans<n) { time=time+1; ans+=min(p,ans); } } printf("%.2f",time); return 0; }
                              ^
foo.cpp:15:429: error: 'printf' was not declared in this scope
  scanf("%ld %ld %ld",&n,&p,&m); for (i=1;i<=m;i++) { scanf("%lf%lf",&a[i],&b[i]); b[i]+=a[i]; } paixu(); ans=1;time=0;k=1;go=false; while (ans<n) { while ((a[k]-time<1)&&(k<=m)) { if (b[k]>time) time=b[k]; k++; } if (k>m) { go=true; break; } t=long(a[k]-time); while (t>0) { time=time+1; ans+=min(p,ans); t--; if (ans>n) break; } if (ans>n) break; } if (go) { while (ans<n) { time=time+1; ans+=min(p,ans); } } printf("%.2f",time); return 0; }
                                                                                                                                                                                                                                                                                                                                                                                                                                             ^

信息

递交者
类型
递交
题目
P1401 复制CS
语言
C++
递交时间
2015-11-04 22:29:06
评测时间
2015-11-04 22:29:06
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes