답안 #1034833

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1034833 2024-07-25T19:30:28 Z ethanv13 비밀 (JOI14_secret) C++17
컴파일 오류
0 ms 0 KB
#include <bits/stdc++.h>
#include <secret.h>
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
#pragma GCC target("avx")
#pragma GCC optimize(3)
#pragma GCC optimize("Ofast")
#define ll long long
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update> 
using namespace std;
using namespace __gnu_pbds;
int sps[15][1005];
int l2(int p){
	return 31-__builtin_clz(p);
}
void sps(int n,int a[]){
	int k=l2(n);
	for(int i=0;i<n;++i){
		sps[0][i]=a[i];
	}
	for(int i=1;i<=k;++i){
		for(int j=0;j+(1<<i)<=n;++j){
			sps[i][j]=secret(sps[i-1][j],sps[i-1][j+(1<<(i-1))]);
		}
	}
}
void INIT(int N,int a[]){
    sps(N,a);
}
int query(int L,int R){
    int i = l2(R-L+1);
	int minimum = secret(sps[i][L], sps[i][R - (1 << i) + 1]);
	return minimum;
}

Compilation message

secret.cpp:16:23: error: 'void sps(int, int*)' redeclared as different kind of entity
   16 | void sps(int n,int a[]){
      |                       ^
secret.cpp:12:5: note: previous declaration 'int sps [15][1005]'
   12 | int sps[15][1005];
      |     ^~~
secret.cpp: In function 'void sps(int, int*)':
secret.cpp:23:14: error: 'secret' was not declared in this scope; did you mean 'Secret'?
   23 |    sps[i][j]=secret(sps[i-1][j],sps[i-1][j+(1<<(i-1))]);
      |              ^~~~~~
      |              Secret
secret.cpp: In function 'void INIT(int, int*)':
secret.cpp:28:12: error: 'sps' cannot be used as a function
   28 |     sps(N,a);
      |            ^
secret.cpp: In function 'int query(int, int)':
secret.cpp:32:16: error: 'secret' was not declared in this scope; did you mean 'Secret'?
   32 |  int minimum = secret(sps[i][L], sps[i][R - (1 << i) + 1]);
      |                ^~~~~~
      |                Secret