제출 #62178

#제출 시각아이디문제언어결과실행 시간메모리
62178aome앵무새 (IOI11_parrots)C++17
컴파일 에러
0 ms0 KiB
#include "encoder.h" #include "encoderlib.h" #include <bits/stdc++.h> using namespace std; static const int L = 6; static int A[L * L * L * L], B[320]; void encode(int N, int M[]) { vector< pair<int, int> > vec; for (int i = 0; i < 625; ++i) { int val = i; int cnt = 0; for (int j = 0; j < 4; ++j) { cnt += val % L, val /= L; } vec.push_back({cnt, i}); } sort(vec.begin(), vec.end()); for (int i = 0; i < 320; ++i) A[vec[i].second] = i, B[i] = vec[i].second; for (int i = 0; i < N; ++i) { int P = -1; for (int j = 0; j < i; ++j) { if (M[j] == M[i]) { P = j; break; } } int val = M[i]; if (P != -1) val = 256 + P; val = B2[val]; for (int j = 0; j < 4; ++j) { int tmp = val % L; val /= L; while (tmp--) send(i * 4 + j); } } }
#include "decoder.h" #include "decoderlib.h" #include <bits/stdc++.h> using namespace std; static const int L = 6; static int res[64]; static int cnt[256]; static int A[L * L * L * L], B[320]; void decode(int N, int L, int X[]) { vector< pair<int, int> > vec; for (int i = 0; i < L * L * L * L; ++i) { int val = i; int cnt = 0; for (int j = 0; j < 4; ++j) { cnt += val % L, val /= L; } vec.push_back({cnt, i}); } sort(vec.begin(), vec.end()); for (int i = 0; i < 320; ++i) A[vec[i].second] = i, B[i] = vec[i].second; memset(cnt, 0, sizeof cnt); for (int i = 0; i < L; ++i) cnt[X[i]]++; for (int i = 0; i < N; ++i) { int val = 0; for (int j = 3; j >= 0; --j) { val = val * L + cnt[i * 4 + j]; } val = A[val]; if (val < 256) res[i] = val; else res[i] = res[val - 256]; output(res[i]); } }

컴파일 시 표준 에러 (stderr) 메시지

encoder.cpp: In function 'void encode(int, int*)':
encoder.cpp:31:9: error: 'B2' was not declared in this scope
   val = B2[val];
         ^~
encoder.cpp:31:9: note: suggested alternative: 'B'
   val = B2[val];
         ^~
         B