QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#65653#4585. Greedy KnapsackGuanYunchangCompile Error//C1.3kb2022-12-02 19:19:212022-12-02 19:19:23

Details

answer.code:1:1: error: unknown type name ‘def’
    1 | def Greedy_knapsack(Weight, w, v):
      | ^~~
answer.code: In function ‘Greedy_knapsack’:
answer.code:1:34: error: expected declaration specifiers before ‘:’ token
    1 | def Greedy_knapsack(Weight, w, v):
      |                                  ^
answer.code:3:7: error: invalid preprocessing directive #?
    3 |     # ??????
      |       ^
answer.code:6:7: error: invalid preprocessing directive #?
    6 |     # ????????
      |       ^
answer.code:8:11: error: invalid preprocessing directive #?
    8 |         # ?????????, ????
      |           ^
answer.code:11:11: error: invalid preprocessing directive #?
   11 |         # ??????????
      |           ^
answer.code:12:11: error: invalid preprocessing directive #?
   12 |         # ????????????????, ????????
      |           ^
answer.code:15:15: error: invalid preprocessing directive #?
   15 |             # ??????????????
      |               ^
answer.code:16:40: error: expected declaration specifiers before ‘)’ token
   16 |             table.append({arr[i][0]: 1})
      |                                        ^
answer.code:17:15: error: invalid preprocessing directive #?
   17 |             # ???????????????
      |               ^
answer.code:19:11: error: invalid preprocessing directive #?
   19 |         # ?????????????????
      |           ^
answer.code:21:15: error: invalid preprocessing directive #?
   21 |             # ??????????
      |               ^
answer.code:23:15: error: invalid preprocessing directive #?
   23 |             # ??????????????
      |               ^
answer.code:24:65: error: expected declaration specifiers before ‘)’ token
   24 |             table.append({arr[i][0]: round(Weight/arr[i][1], 2)})
      |                                                                 ^
answer.code:25:15: error: invalid preprocessing directive #?
   25 |             # ????????
      |               ^
answer.code:26:30: warning: trigraph ??' ignored, use -trigraphs to enable [-Wtrigraphs]
   26 |             table.append({'????' : sum})
      |                               
answer.code:26:27: warning: multi-character character constant [-Wmultichar]
   26 |             table.append({'????' : sum})
      |                           ^~~~~~
answer.code:26:40: error: expected declaration specifiers before ‘)’ token
   26 |             table.append({'????' : sum})
      |                                        ^
answer.code:31:3: error: invalid preprocessing directive #?
   31 | # ??????
      |   ^
answer.code:33:7: error: invalid preprocessing directive #?
   33 |     # ??????
      |       ^
answer.code:35:7: error: invalid preprocessing directive #?
   35 |     # ????
      |       ^
answer.code:37:7: error: invalid preprocessing directive #?
   37 |     # ??????
      |       ^
answer.code:39:11: error: invalid preprocessing directive #?
   39 |         # ???????????:????, ????, ????, ??????
      |           ^
answer.code:41:7: error: invalid preprocessing directive #?
   41 |     # ?????????????????????
      |       ^
answer.code:43:7: error: invalid preprocessing directive #?
   43 |     # ????
      |       ^
answer.code:47:16: warning: character constant too long for its type
   47 | if __name__ == '__main__':
      |                ^~~~~~~~~~
answer.code:48:7: error: invalid preprocessing directive #?
   48 |     # ????
      |       ^
answer.code:50:7: error: invalid preprocessing directive #?
   50 |     # ??????
      |       ^
answer.code:52:7: error: invalid preprocessing directive #?
   52 |     # ??????
      |       ^
answer.code:1:5: warning: type of ‘Weight’ defaults to ‘int’ [-Wimplicit-int]
    1 | def Greedy_knapsack(Weight, w, v):
      |     ^~~~~~~~~~~~~~~
answer.code:1:5: warning: type of ‘w’ defaults to ‘int’ [-Wimplicit-int]
answer.code:1:5: warning: type of ‘v’ defaults to ‘int’ [-Wimplicit-int]