답안 #1106038

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1106038 2024-10-29T03:05:45 Z hainam2k9 비밀 (JOI14_secret) C++17
컴파일 오류
0 ms 0 KB
#include <bits/stdc++.h>
#define tt cin.tie(0), cout.tie(0), ios_base::sync_with_stdio(0)
#define fo freopen((NAME+".INP").c_str(), "r", stdin), freopen((NAME+".OUT").c_str(), "w", stdout)
#define ll long long
#define ull unsigned long long
#define i128 __int128
#define db long double
#define sz(a) ((int)(a).size())
#define pb emplace_back
#define pf emplace_front
#define pob pop_back
#define pof pop_front
#define lb lower_bound
#define ub upper_bound
#define fi first
#define se second
#define ins emplace
using namespace std;
const int MOD = 1e9+7, MAXN = 1e5+5;
const string NAME = "";
pair<int,bool> val[1005][1005];
void preprocess(int l, int r, int a[]){
    int mid=(l+r)>>1;
    val[mid][mid].fi=a[mid], val[mid][mid].se=1;
    if(l==r) return;
    preprocess(l,mid,a);
    preprocess(mid+1,r,a);
    for(int i = mid-1; i>=l; --i)
        if(!val[i][mid].se) val[i][mid].fi=Secret(val[i+1][mid].fi,a[i]), val[i][mid].se=1;
    for(int i = mid+1; i<=r; ++i)
        if(!val[mid][i].se) val[mid][i].fi=Secret(val[mid][i-1].fi,a[i]), val[mid][i].se=1;
}
void Init(int n, int a[]){
    for(int i = n; i>0; --i)
        swap(a[i],a[i-1]);
    preprocess(1,n,a);
}
int Query(int l, int r){
    for(int i = l; i<=r; ++i)
        if(val[l][i].se&&val[i][r].se) return Secret(val[l][i].fi,val[i][r].fi);
    return a[l];
}

Compilation message

secret.cpp: In function 'void preprocess(int, int, int*)':
secret.cpp:29:44: error: 'Secret' was not declared in this scope
   29 |         if(!val[i][mid].se) val[i][mid].fi=Secret(val[i+1][mid].fi,a[i]), val[i][mid].se=1;
      |                                            ^~~~~~
secret.cpp:31:44: error: 'Secret' was not declared in this scope
   31 |         if(!val[mid][i].se) val[mid][i].fi=Secret(val[mid][i-1].fi,a[i]), val[mid][i].se=1;
      |                                            ^~~~~~
secret.cpp: In function 'int Query(int, int)':
secret.cpp:40:47: error: 'Secret' was not declared in this scope
   40 |         if(val[l][i].se&&val[i][r].se) return Secret(val[l][i].fi,val[i][r].fi);
      |                                               ^~~~~~
secret.cpp:41:12: error: 'a' was not declared in this scope
   41 |     return a[l];
      |            ^