Compile Error

/in/foo.cc: In function 'int q(int, int, int, int)':
/in/foo.cc:4:25: error: 'n' was not declared in this scope
    4 |         for(int j=i+1;j<n;j++){
      |                         ^
/in/foo.cc:5:19: error: 'a' was not declared in this scope
    5 |                 y=a[i]&a[j];
      |                   ^
/in/foo.cc:12:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   12 | int main(){
      |         ^~
/in/foo.cc:12:9: note: remove parentheses to default-initialize a variable
   12 | int main(){
      |         ^~
      |         --
/in/foo.cc:12:9: note: or replace parentheses with braces to value-initialize a variable
/in/foo.cc:12:11: error: a function-definition is not allowed here before '{' token
   12 | int main(){
      |           ^
/in/foo.cc:11:5: warning: unused variable 'a' [-Wunused-variable]
   11 | int a[1000005];
      |     ^

信息

递交者
类型
递交
题目
P2562 烹饪问题5级T2 2023.12
语言
C++
递交时间
2026-11-21 17:48:33
评测时间
2026-11-21 17:48:33
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes