답안 #479801

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
479801 2021-10-13T07:27:12 Z MohammadAghil 비밀 (JOI14_secret) C++14
컴파일 오류
0 ms 0 KB
#include <bits/stdc++.h> 
#include "secret.h"
using  namespace std;
typedef  long long ll;
typedef  pair<int, int> pp;
#define  rep(i,l,r) for(int i = (l); i < r; i++)
#define  per(i,r,l) for(int i = (r); i >= l; i--)
#define  all(x) x.begin(), x.end()
#define  sz(x) (int)(x).size()
#define  pb push_back
#define  ff first
#define  ss second 
// #include <ext/pb_ds/assoc_container.hpp>
// using namespace __gnu_pbds;
// template <class T> using Tree = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
 
const ll mod = 998244353, maxn = 1e3 + 5, inf = 1e9 + 5;

int a[maxn], tag[maxn], val[maxn][20];

void slv(int lx, int rx, int t){
    if(lx >= rx) return;
    int mid = (lx + rx) >> 1;
    tag[mid] = t;
    val[mid][t] = a[mid];
    per(i,mid-1,lx){
        val[i][t] = Secret(val[i + 1][t], a[i]);
    }
    val[mid + 1][t] = a[mid + 1];
    rep(i,mid + 2, rx + 1){
        val[i][t] = Secret(val[i - 1][t], a[i]);
    }
    slv(lx, mid-1, t + 1), slv(mid + 1, rx, t + 1);
}

int Query(int L, int R) {
	if (L == R) return a[L];
	int mi = inf;
    rep(i,L,R + 1){
        mi = min(tag[i], mi);
    }
    int ans = query(val[L][mi], val[R][mi]);
    return ans;
}

void Init(int N, int A[]) {
	rep(i,0,N) {
        a[i] = A[i];
        tag[i] = inf;
    }
    slv(0, N - 1, 0);
}

Compilation message

secret.cpp: In function 'int Query(int, int)':
secret.cpp:42:15: error: 'query' was not declared in this scope; did you mean 'Query'?
   42 |     int ans = query(val[L][mi], val[R][mi]);
      |               ^~~~~
      |               Query