QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#44937#4561. Catfish FarmGuanYunchangCompile Error//C++17819b2022-08-22 11:47:382022-08-22 11:47:40

詳細信息

answer.code:9:17: error: expected ‘,’ or ‘...’ before ‘X’
    9 | bool tsk1(int []X, int M) {
      |                 ^
answer.code: In function ‘bool tsk1(int*)’:
answer.code:10:23: error: ‘M’ was not declared in this scope
   10 |         for(int i=0;i<M;i++) {
      |                       ^
answer.code:11:20: error: ‘X’ was not declared in this scope
   11 |                 if(X[i] % 2 == 1) return 0;
      |                    ^
answer.code: At global scope:
answer.code:16:17: error: expected ‘,’ or ‘...’ before ‘X’
   16 | bool tsk2(int []X, int M) {
      |                 ^
answer.code: In function ‘bool tsk2(int*)’:
answer.code:17:23: error: ‘M’ was not declared in this scope
   17 |         for(int i=0;i<M;i++) {
      |                       ^
answer.code:18:20: error: ‘X’ was not declared in this scope
   18 |                 if(X[i] > 1) return 0;
      |                    ^
answer.code: At global scope:
answer.code:23:35: error: expected ‘,’ or ‘...’ before ‘X’
   23 | ll max_weights(int N, int M, int[]X, int[]Y, int[]W) {
      |                                   ^
answer.code: In function ‘ll max_weights(int, int, int*)’:
answer.code:25:17: error: ‘X’ was not declared in this scope
   25 |         if(tsk1(X, M)) {
      |                 ^
answer.code:26:45: error: ‘W’ was not declared in this scope
   26 |                 for(int i=0;i<M;i++) ans += W[i];
      |                                             ^
answer.code:31:47: error: ‘W’ was not declared in this scope
   31 |                         if(X[i] == 1) val2 += W[i];
      |                                               ^
answer.code:32:38: error: ‘W’ was not declared in this scope
   32 |                         else val1 += W[i];
      |                                      ^
answer.code: In function ‘int main()’:
answer.code:45:17: error: ‘max_weight’ was not declared in this scope; did you mean ‘max_weights’?
   45 |         cout << max_weight(n, m, x, y, w) << '\n';
      |                 ^~~~~~~~~~
      |                 max_weights