Compile Error

foo.cc:24:2: error: stray ‘#’ in program
   24 | }#include<bits/stdc++.h>
      |  ^
foo.cc: In function ‘int check(int)’:
foo.cc:8:42: error: expected ‘;’ before ‘y’
    8 |                 cnt=ceil(1.0*(y-m)/(b-a))
      |                                          ^
      |                                          ;
    9 |                 y-=cnt*(b-a);
      |                 ~                         
foo.cc: In function ‘int main()’:
foo.cc:19:26: error: ‘l’ was not declared in this scope
   19 |                 int mid=(l+m)/2;
      |                          ^
foo.cc: At global scope:
foo.cc:24:3: error: ‘include’ does not name a type
   24 | }#include<bits/stdc++.h>
      |   ^~~~~~~
foo.cc:26:5: error: redefinition of ‘int m’
   26 | int m,n,a,b,ans;
      |     ^
foo.cc:3:5: note: ‘int m’ previously declared here
    3 | int m,n,a,b,ans;
      |     ^
foo.cc:26:7: error: redefinition of ‘int n’
   26 | int m,n,a,b,ans;
      |       ^
foo.cc:3:7: note: ‘int n’ previously declared here
    3 | int m,n,a,b,ans;
      |       ^
foo.cc:26:9: error: redefinition of ‘int a’
   26 | int m,n,a,b,ans;
      |         ^
foo.cc:3:9: note: ‘int a’ previously declared here
    3 | int m,n,a,b,ans;
      |         ^
foo.cc:26:11: error: redefinition of ‘int b’
   26 | int m,n,a,b,ans;
      |           ^
foo.cc:3:11: note: ‘int b’ previously declared here
    3 | int m,n,a,b,ans;
      |           ^
foo.cc:26:13: error: redefinition of ‘int ans’
   26 | int m,n,a,b,ans;
      |             ^~~
foo.cc:3:13: note: ‘int ans’ previously declared here
    3 | int m,n,a,b,ans;
      |             ^~~
foo.cc:27:5: error: redefinition of ‘int check(int)’
   27 | int check(int z){
      |     ^~~~~
foo.cc:4:5: note: ‘int check(int)’ previously defined here
    4 | int check(int z){
      |     ^~~~~
foo.cc: In function ‘int check(int)’:
foo.cc:31:42: error: expected ‘;’ before ‘y’
   31 |                 cnt=ceil(1.0*(y-m)/(b-a))
      |                                          ^
      |                                          ;
   32 |                 y-=cnt*(b-a);
      |                 ~                         
foo.cc: At global scope:
foo.cc:37:5: error: redefinition of ‘int main()’
   37 | int main(){
      |     ^~~~
foo.cc:14:5: note: ‘int main()’ previously defined here
   14 | int main(){
      |     ^~~~
foo.cc: In function ‘int main()’:
foo.cc:42:26: error: ‘l’ was not declared in this scope
   42 |                 int mid=(l+m)/2;
      |                          ^

信息

递交者
类型
递交
题目
P2953 奖品兑换
语言
C++
递交时间
2025-08-15 12:13:29
评测时间
2025-08-23 22:07:22
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes