/ Vijos /

记录详情

Compile Error

foo.cc:4:16: error: expected ',' or '...' before 'arr'
 int sort(int[] arr,int length) {
                ^~~
foo.cc: In function 'int sort(int*)':
foo.cc:5:14: error: 'length' was not declared in this scope
  for (int i=(length-2)/2;i>=0;i++) {
              ^~~~~~
foo.cc:5:14: note: suggested alternative: 'le32toh'
  for (int i=(length-2)/2;i>=0;i++) {
              ^~~~~~
              le32toh
foo.cc:6:8: error: 'arr' was not declared in this scope
   sink(arr,i,length-1);
        ^~~
foo.cc:6:3: error: 'sink' was not declared in this scope
   sink(arr,i,length-1);
   ^~~~
foo.cc:6:3: note: suggested alternative: 'uint'
   sink(arr,i,length-1);
   ^~~~
   uint
foo.cc: At global scope:
foo.cc:11:15: error: expected ',' or '...' before 'arr'
 int pop(int[] arr, int length ) {
               ^~~
foo.cc: In function 'int pop(int*)':
foo.cc:12:15: error: 'arr' was not declared in this scope
  int result = arr[0];
               ^~~
foo.cc:13:15: error: 'length' was not declared in this scope
  arr[0] = arr[length-1];
               ^~~~~~
foo.cc:13:15: note: suggested alternative: 'le32toh'
  arr[0] = arr[length-1];
               ^~~~~~
               le32toh
foo.cc: At global scope:
foo.cc:18:16: error: expected ',' or '...' before 'arr'
 int push(int[] arr,int length,int val) {
                ^~~
foo.cc: In function 'int push(int*)':
foo.cc:19:2: error: 'arr' was not declared in this scope
  arr[length]=val;
  ^~~
foo.cc:19:6: error: 'length' was not declared in this scope
  arr[length]=val;
      ^~~~~~
foo.cc:19:6: note: suggested alternative: 'le32toh'
  arr[length]=val;
      ^~~~~~
      le32toh
foo.cc:19:14: error: 'val' was not declared in this scope
  arr[length]=val;
              ^~~
foo.cc:21:1: warning: no return statement in function returning non-void [-Wreturn-type]
 }
 ^
foo.cc: At global scope:
foo.cc:24:16: error: expected ',' or '...' before 'arr'
 int sink(int[] arr,int k,int n) {
                ^~~
foo.cc: In function 'int sink(int*)':
foo.cc:25:10: error: 'k' was not declared in this scope
  while(2*k+1<=n) {
          ^
foo.cc:25:15: error: 'n' was not declared in this scope
  while(2*k+1<=n) {
               ^
foo.cc:27:13: error: 'arr' was not declared in this scope
   if(j<n && arr[j+1]<arr[j]) {
             ^~~
foo.cc:30:8: error: 'arr' was not declared in this scope
   swap(arr,k,j);
        ^~~
foo.cc: At global scope:
foo.cc:36:16: error: expected ',' or '...' before 'arr'
 int swap(int[] arr,int a,int b) {
                ^~~
foo.cc: In function 'int swap(int*)':
foo.cc:37:11: error: 'arr' was not declared in this scope
  int temp=arr[a];
           ^~~
foo.cc:37:15: error: 'a' was not declared in this scope
  int temp=arr[a];
               ^
foo.cc:38:13: error: 'b' was not declared in this scope
  arr[a]=arr[b];
             ^
foo.cc: In function 'int main()':
foo.cc:53:15: error: too many arguments to function 'int sort(int*)'
  sort(a,length);
               ^
foo.cc:4:5: note: declared here
 int sort(int[] arr,int length) {
     ^~~~
foo.cc:57:23: error: too many arguments to function 'int pop(int*)'
    tmp+=pop(a,length--);
                       ^
foo.cc:11:5: note: declared here
 int pop(int[] arr, int length ) {
     ^~~
foo.cc:60:22: error: too many arguments to function 'int push(int*)'
   push(a,length++,tmp);
                      ^
foo.cc:18:5: note: declared here
 int push(int[] arr,int length,int val) {
     ^~~~

信息

递交者
类型
递交
题目
P1097 合并果子
语言
C++
递交时间
2020-11-12 23:04:27
评测时间
2020-11-12 23:04:27
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes