제출 #1247363

#제출 시각아이디문제언어결과실행 시간메모리
1247363MateiKing80비교 (balkan11_cmp)C++20
컴파일 에러
0 ms0 KiB
#include "cmp.h" #include <bits/stdc++.h> using namespace std; int gib(int x, int bit) { if (x & (1 << bit)) return 1; return 0; } const int bulan = 4096; void remember(int a) { a += bulan; while (a) { bit_set(a); a = (a - 1) / 4; } } int compare(int b) { b += bulan; vector<int> nrs; while (b) { nrs.push_back(b); b = (b - 1) / 4; } int pos = -1; for (int pas = 16; pas; pas >>= 1) if (pos + pas < (int)nrs.size() && !bit_get(nrs[pos + pas])) pos += pas; if (pos == -1) return 0; vector<int> v(4); int x = ((b - 1) / 4) * 4 + 1; v[b - x] ++; if (b == x) return -1; if (b == x + 1) return get_bit(x) ? 1 : -1; if (b == x + 2) return get_bit(x + 3) ? -1 : 1; if (b == x + 3) return 1; }

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

cmp.cpp: In function 'int compare(int)':
cmp.cpp:41:24: error: 'get_bit' was not declared in this scope
   41 |                 return get_bit(x) ? 1 : -1;
      |                        ^~~~~~~
cmp.cpp:43:24: error: 'get_bit' was not declared in this scope
   43 |                 return get_bit(x + 3) ? -1 : 1;
      |                        ^~~~~~~