/ Vijos /

记录详情

Compile Error

/in/foo.cc: In function 'void addToHash(long long int)':
/in/foo.cc:57:32: error: no matching function for call to '_nodeH::_nodeH(void*)'
 p = (nodeH)malloc(sizeof(nodeH));
                                ^
/in/foo.cc:6:16: note: candidate: _nodeH::_nodeH()
 typedef struct _nodeH{
                ^~~~~~
/in/foo.cc:6:16: note:   candidate expects 0 arguments, 1 provided
/in/foo.cc:6:16: note: candidate: constexpr _nodeH::_nodeH(const _nodeH&)
/in/foo.cc:6:16: note:   no known conversion for argument 1 from 'void*' to 'const _nodeH&'
/in/foo.cc:6:16: note: candidate: constexpr _nodeH::_nodeH(_nodeH&&)
/in/foo.cc:6:16: note:   no known conversion for argument 1 from 'void*' to '_nodeH&&'
/in/foo.cc:58:2: error: base operand of '->' has non-pointer type 'nodeH {aka _nodeH}'
 p->key = key;
  ^~
/in/foo.cc:59:2: error: base operand of '->' has non-pointer type 'nodeH {aka _nodeH}'
 p->next = hash[key % MAX_SIZE];
  ^~
/in/foo.cc:60:24: error: cannot convert 'nodeH {aka _nodeH}' to 'nodeH* {aka _nodeH*}' in assignment
 hash[key % MAX_SIZE] = p;
                        ^
/in/foo.cc: In function 'int isInHash(long long int)':
/in/foo.cc:63:30: error: conversion from 'nodeH* {aka _nodeH*}' to non-scalar type 'nodeH {aka _nodeH}' requested
 nodeH p = hash[key % MAX_SIZE];
           ~~~~~~~~~~~~~~~~~~~^
/in/foo.cc:64:9: error: no match for 'operator!=' (operand types are 'nodeH {aka _nodeH}' and 'long int')
 while(p != NULL){
         ^
/in/foo.cc:65:5: error: base operand of '->' has non-pointer type 'nodeH {aka _nodeH}'
 if(p->key == key)
     ^~
/in/foo.cc:67:6: error: base operand of '->' has non-pointer type 'nodeH {aka _nodeH}'
 p = p->next;
      ^~
/in/foo.cc: In function 'void addToQueue(long long int, int)':
/in/foo.cc:76:41: error: no matching function for call to '_nodeQ::_nodeQ(void*)'
 tail->next = (nodeQ)malloc(sizeof(nodeQ));
                                         ^
/in/foo.cc:10:16: note: candidate: _nodeQ::_nodeQ()
 typedef struct _nodeQ{
                ^~~~~~
/in/foo.cc:10:16: note:   candidate expects 0 arguments, 1 provided
/in/foo.cc:10:16: note: candidate: constexpr _nodeQ::_nodeQ(const _nodeQ&)
/in/foo.cc:10:16: note:   no known conversion for argument 1 from 'void*' to 'const _nodeQ&'
/in/foo.cc:10:16: note: candidate: constexpr _nodeQ::_nodeQ(_nodeQ&&)
/in/foo.cc:10:16: note:   no known conversion for argument 1 from 'void*' to '_nodeQ&&'

信息

递交者
类型
递交
题目
P1252 @.@斗地主
语言
C++
递交时间
2017-09-09 16:25:15
评测时间
2017-09-09 16:25:15
评测机
分数
0
总耗时
38ms
峰值内存
4.566 MiB