记录详情

Compile Error

/in/foo.cc: In function 'int Joseph(int, int, int*)':
/in/foo.cc:21:33: error: invalid conversion from 'int' to 'int*' [-fpermissive]
    return ((Joseph(n-1, m, a[i+1])+ a[i+1])%n);
                            ~~~~~^
/in/foo.cc:4:5: note:   initializing argument 3 of 'int Joseph(int, int, int*)'
 int Joseph(int n, int m, int *a)
     ^~~~~~
/in/foo.cc: In function 'int main()':
/in/foo.cc:35:21: error: invalid conversion from 'int' to 'int*' [-fpermissive]
  cout<<Joseph(N, m, *a);
                     ^~
/in/foo.cc:4:5: note:   initializing argument 3 of 'int Joseph(int, int, int*)'
 int Joseph(int n, int m, int *a)
     ^~~~~~
/in/foo.cc: In function 'int Joseph(int, int, int*)':
/in/foo.cc:24:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^

信息

递交者
类型
递交
题目
2-2 约瑟夫问题
比赛
南师大2018年蓝桥杯热身赛
语言
C++
递交时间
2018-12-12 14:23:53
评测时间
2018-12-12 14:23:53
评测机
分数
0
总耗时
273ms
峰值内存
29.688 MiB