/ CWOI /

记录详情

Compile Error

/in/foo.cc: In function 'int read()':
/in/foo.cc:11:2: warning: this 'while' clause does not guard... [-Wmisleading-indentation]
  while(!isdigit(ch=getchar())) if(ch=='-') f=-1;x=ch-48;
  ^~~~~
/in/foo.cc:11:49: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the 'while'
  while(!isdigit(ch=getchar())) if(ch=='-') f=-1;x=ch-48;
                                                 ^
/in/foo.cc: In function 'int build(int, int)':
/in/foo.cc:27:12: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   int mid=l+r>>1;
           ~^~
/in/foo.cc: In function 'int update(int, int, int, int, int)':
/in/foo.cc:40:11: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
  int mid=l+r>>1;
          ~^~
/in/foo.cc: In function 'int query(int, int, int, int, int)':
/in/foo.cc:52:11: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
  int mid=l+r>>1;
          ~^~
/in/foo.cc: In function 'int main()':
/in/foo.cc:64:11: error: reference to 'hash' is ambiguous
   int pos=hash(a[i]);
           ^~~~
/in/foo.cc:33:5: note: candidates are: int hash(int)
 int hash(int x){
     ^~~~
In file included from /usr/include/c++/6/bits/basic_string.h:5643:0,
                 from /usr/include/c++/6/string:52,
                 from /usr/include/c++/6/bits/locale_classes.h:40,
                 from /usr/include/c++/6/bits/ios_base.h:41,
                 from /usr/include/c++/6/ios:42,
                 from /usr/include/c++/6/ostream:38,
                 from /usr/include/c++/6/iostream:39,
                 from /in/foo.cc:2:
/usr/include/c++/6/bits/functional_hash.h:58:12: note:                 template<class _Tp> struct std::hash
     struct hash;
            ^~~~
/in/foo.cc: In function 'int query(int, int, int, int, int)':
/in/foo.cc:57:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^

信息

递交者
类型
递交
题目
2017.07.14 P1 第 k 大的数
语言
C++
递交时间
2018-01-29 12:44:46
评测时间
2018-01-29 12:44:46
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes