답안 #52456

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
52456 2018-06-26T04:15:31 Z 0^0(#1358) 비밀 (JOI14_secret) C++11
30 / 100
752 ms 4716 KB
#include <bits/stdc++.h>
#include "secret.h"
using namespace std;
int tree[4005];
int n;
const int inf = 0x3f3f3f3f;
void init(int arr[], int le, int ri, int node) {
	if (le == ri) {
		tree[node] = arr[le];
		return;
	}
	int mid = (le + ri) / 2;
	init(arr, le, mid, node * 2);
	init(arr, mid + 1, ri, node * 2 + 1);
	tree[node] = Secret(tree[node * 2], tree[node * 2 + 1]);
}
int query(int le, int ri, int nodele, int noderi, int node) {
	if (le > noderi || ri < nodele)return inf;
	if (le <= nodele && noderi <= ri)return tree[node];
	int mid = (nodele + noderi) / 2;
	int a = query(le, ri, nodele, mid, node * 2);
	int b = query(le, ri, mid + 1, noderi, node * 2 + 1);
	if (a == inf)return b;
	if (b == inf)return a;
	return Secret(a, b);
}
void Init(int N, int A[]) {
	n = N;
	init(A, 0, n - 1, 1);
}

int Query(int L, int R) {
	return query(L,R,0,n-1,1);
}
# 결과 실행 시간 메모리 Grader output
1 Partially correct 224 ms 2388 KB Output is partially correct - number of calls to Secret by Init = 510, maximum number of calls to Secret by Query = 13
2 Partially correct 227 ms 2592 KB Output is partially correct - number of calls to Secret by Init = 511, maximum number of calls to Secret by Query = 14
3 Partially correct 228 ms 2592 KB Output is partially correct - number of calls to Secret by Init = 512, maximum number of calls to Secret by Query = 15
4 Partially correct 656 ms 4472 KB Output is partially correct - number of calls to Secret by Init = 998, maximum number of calls to Secret by Query = 15
5 Partially correct 657 ms 4552 KB Output is partially correct - number of calls to Secret by Init = 999, maximum number of calls to Secret by Query = 15
6 Partially correct 597 ms 4552 KB Output is partially correct - number of calls to Secret by Init = 999, maximum number of calls to Secret by Query = 4
7 Partially correct 752 ms 4592 KB Output is partially correct - number of calls to Secret by Init = 999, maximum number of calls to Secret by Query = 16
8 Partially correct 734 ms 4592 KB Output is partially correct - number of calls to Secret by Init = 999, maximum number of calls to Secret by Query = 16
9 Partially correct 732 ms 4716 KB Output is partially correct - number of calls to Secret by Init = 999, maximum number of calls to Secret by Query = 16
10 Partially correct 737 ms 4716 KB Output is partially correct - number of calls to Secret by Init = 999, maximum number of calls to Secret by Query = 16