제출 #1313353

#제출 시각아이디문제언어결과실행 시간메모리
1313353thieunguyenhuypopa (BOI18_popa)C++20
컴파일 에러
0 ms0 KiB
#ifndef hwe #include "popa.h" #endif #include <bits/stdc++.h> using namespace std; #define POPCOUNT(n) (__builtin_popcountll((n))) #define CLZ(n) (__builtin_clzll((n))) #define CTZ(n) (__builtin_ctzll((n))) #define LOG(n) (63 - __builtin_clzll((n))) #define BIT(n, i) (((n) >> (i)) & 1ll) #define MASK(i) (1ll << (i)) #define FLIP(n, i) ((n) ^ (1ll << (i))) #define ON(n, i) ((n) | MASK(i)) #define OFF(n, i) ((n) & ~MASK(i)) #define Int __int128 #define fi first #define se second typedef long long ll; typedef unsigned long long ull; typedef long double ld; typedef pair<int, int> pii; typedef pair<long long, long long> pll; typedef pair<long long, int> pli; typedef pair<int, long long> pil; typedef vector<pair<int, int>> vii; typedef vector<pair<long long, long long>> vll; typedef vector<pair<long long, int>> vli; typedef vector<pair<int, long long>> vil; template <class T1, class T2> bool maximize(T1 &x, T2 y) { if (x < y) { x = y; return true; } return false; } template <class T1, class T2> bool minimize(T1 &x, T2 y) { if (x > y) { x = y; return true; } return false; } template <class T> void remove_duplicate(vector<T> &ve) { sort (ve.begin(), ve.end()); ve.resize(unique(ve.begin(), ve.end()) - ve.begin()); } mt19937_64 rng(chrono::high_resolution_clock::now().time_since_epoch().count()); long long random(long long l, long long r) { return uniform_int_distribution<long long>(l, r)(rng); } template <class T> T random(T r) { return rng() % r; } const int N = 1000 + 5; const int MOD = 1e9 + 7; const int inf = 1e9; const long long INF = 1e18; int L[N], R[N]; int dnc(int l, int r) { if (l > r) return -1; if (l == r) { L[l] = R[l] = -1; return l; } int low = l, high = r - 1, root = r; while (low <= high) { int mid = (low + high) >> 1; if (query(l, mid) == query(l, r)) high = (root = mid) - 1; else low = mid + 1; } L[root] = dnc(l, root - 1); R[root] = dnc(root + 1, r); return root; } int solve(int n, int *Left, int *Right) { int root = dnc(0, n - 1); for (int i = 0; i < n; ++i) Left[i] = L[i], Right[i] = R[i]; } #ifdef hwe signed main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); return 0; } #endif

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

popa.cpp: In function 'int dnc(int, int)':
popa.cpp:80:26: error: too few arguments to function 'int query(int, int, int, int)'
   80 |                 if (query(l, mid) == query(l, r)) high = (root = mid) - 1;
      |                     ~~~~~^~~~~~~~
In file included from popa.cpp:2:
popa.h:4:5: note: declared here
    4 | int query(int a, int b, int c, int d);
      |     ^~~~~
popa.cpp:80:43: error: too few arguments to function 'int query(int, int, int, int)'
   80 |                 if (query(l, mid) == query(l, r)) high = (root = mid) - 1;
      |                                      ~~~~~^~~~~~
popa.h:4:5: note: declared here
    4 | int query(int a, int b, int c, int d);
      |     ^~~~~
popa.cpp: In function 'int solve(int, int*, int*)':
popa.cpp:92:1: warning: no return statement in function returning non-void [-Wreturn-type]
   92 | }
      | ^