Submission #926628

#TimeUsernameProblemLanguageResultExecution timeMemory
926628myst6Secret (JOI14_secret)C++14
Compilation error
0 ms0 KiB
#pragma GCC optimize("O3,unroll-loops") #pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt") #include <memory.h> #include "secret.h" const int maxn = 1000; int table[10][maxn]; int mask[maxn]; int base[maxn]; void fill(int L, int R, int B) { if (L == R) return; int M = (L + R) / 2; table[B][M] = base[M]; table[B][M+1] = base[M+1]; for (int i=M-1; i>=L; i--) table[B][i] = Secret(base[i], table[B][i+1]); for (int i=M+2; i<=R; i++) table[B][i] = Secret(table[B][i-1], base[i]); for (int i=M+1; i<=R; i++) mask[i] ^= 1 << B; fill(L, M, B+1); fill(M+1, R, B+1); } void Init(int N, int A[]) { std::memset(mask, 0, sizeof mask); for (int i=0; i<N; i++) base[i] = A[i]; fill(0, N-1, 0); } int Query(int L, int R) { if (L == R) return base[L]; int B = __builtin_ctz(mask[L] ^ mask[R]); return Secret(table[B][L], table[B][R]); }

Compilation message (stderr)

secret.cpp: In function 'void Init(int, int*)':
secret.cpp:25:8: error: 'memset' is not a member of 'std'; did you mean 'memset'?
   25 |   std::memset(mask, 0, sizeof mask);
      |        ^~~~~~
In file included from /usr/include/features.h:461,
                 from /usr/include/memory.h:25,
                 from secret.cpp:4:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:59:1: note: 'memset' declared here
   59 | __NTH (memset (void *__dest, int __ch, size_t __len))
      | ^~~~~