/ Vijos /

记录详情

Compile Error

/in/foo.cc:9:11: error: 'long long int link [105]' redeclared as different kind of entity
    9 | int link[N];
      |           ^
In file included from /usr/include/x86_64-linux-gnu/bits/sigstksz.h:24,
                 from /usr/include/signal.h:328,
                 from /usr/include/c++/12/csignal:42,
                 from /usr/include/x86_64-linux-gnu/c++/12/bits/stdc++.h:43,
                 from /in/foo.cc:1:
/usr/include/unistd.h:819:12: note: previous declaration 'int link(const char*, const char*)'
  819 | extern int link (const char *__from, const char *__to)
      |            ^~~~
/in/foo.cc: In function 'bool fd(long long int)':
/in/foo.cc:17:34: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   17 |                         if(link[i]==0||fd(link[i])) {
      |                                  ^
/in/foo.cc:17:35: warning: comparing the result of pointer addition '(link + ((sizetype)i))' and NULL [-Waddress]
   17 |                         if(link[i]==0||fd(link[i])) {
      |                            ~~~~~~~^~~
/in/foo.cc:17:49: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   17 |                         if(link[i]==0||fd(link[i])) {
      |                                                 ^
/in/foo.cc:17:49: error: invalid conversion from 'int (*)(const char*, const char*) noexcept' {aka 'int (*)(const char*, const char*)'} to 'long long int' [-fpermissive]
   17 |                         if(link[i]==0||fd(link[i])) {
      |                                           ~~~~~~^
      |                                                 |
      |                                                 int (*)(const char*, const char*) noexcept {aka int (*)(const char*, const char*)}
/in/foo.cc:13:13: note:   initializing argument 1 of 'bool fd(long long int)'
   13 | bool fd(int x) {
      |             ^
/in/foo.cc:18:39: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   18 |                                 link[i]=x;
      |                                       ^
/in/foo.cc:18:40: error: assignment of read-only location '*(link + ((sizetype)i))'
   18 |                                 link[i]=x;
      |                                 ~~~~~~~^~

信息

递交者
类型
递交
题目
P1204 CoVH之柯南开锁
语言
C++
递交时间
2025-04-14 16:53:09
评测时间
2025-04-15 00:02:25
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes