QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#737025#7950. Lucky DrawsZhangYiDeCompile Error//C++201.6kb2024-11-12 14:17:502024-11-12 14:17:51

Details

answer.code:9:19: error: ‘int dup [10001][10001]’ redeclared as different kind of entity
    9 | int n, k, dup[N][N], cnt[N], dp[2][N], pre = 1, cur = 0;
      |                   ^
In file included from /usr/include/c++/13/bits/atomic_wait.h:44,
                 from /usr/include/c++/13/bits/atomic_base.h:42,
                 from /usr/include/c++/13/bits/shared_ptr_atomic.h:33,
                 from /usr/include/c++/13/memory:81,
                 from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:56,
                 from answer.code:1:
/usr/include/unistd.h:531:12: note: previous declaration ‘int dup(int)’
  531 | extern int dup (int __fd) __THROW __wur;
      |            ^~~
answer.code: In function ‘void init()’:
answer.code:25:12: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   25 |       dup[i][j] = st.size();
      |            ^
answer.code:25:15: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   25 |       dup[i][j] = st.size();
      |               ^
answer.code:25:17: error: assignment of read-only location ‘*(dup + (((sizetype)i) + ((sizetype)j)))’
   25 |       dup[i][j] = st.size();
      |       ~~~~~~~~~~^~~~~~~~~~~
answer.code: In function ‘void dnc(int, int, int, int)’:
answer.code:35:44: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   35 |     int val = dp[pre][i] + cnt[mid] - dup[i][mid];
      |                                            ^
answer.code:35:49: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   35 |     int val = dp[pre][i] + cnt[mid] - dup[i][mid];
      |                                                 ^
answer.code:35:37: error: invalid operands of types ‘int’ and ‘int(int) noexcept’ to binary ‘operator-’
   35 |     int val = dp[pre][i] + cnt[mid] - dup[i][mid];
      |               ~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~
      |                          |                      |
      |                          int                    int(int) noexcept