답안 #25252

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
25252 2017-06-21T04:53:32 Z 김동현(#1058) 비밀 (JOI14_secret) C++14
6 / 100
636 ms 9204 KB
#include "secret.h"
#include <cstdio>

const int sz = 1024;
struct Seg{
	int dat[sz][sz];
	void ini(int n, int a[]){
		for(int i = 0; i < n; i++) dat[i][i] = a[i];
		for(int i = 2; i <= sz; i *= 2){
			for(int j = 0; j < sz; j += i){
				for(int k = j + i / 2 - 2; k >= j; k--) dat[k][j + i / 2 - 1] = Secret(a[k], dat[k + 1][j + i / 2 - 1]);
				for(int k = j + i / 2 + 1; k <= j + i - 1; k++) dat[j + i / 2][k] = Secret(dat[j + i / 2][k - 1], a[k]);
			}
		}
	}
	int get(int s, int e){
		if(s == e) return dat[s][s];
		int S = 0, E = sz - 1;
		while(true){
			int m = (S + E) / 2;
			if(s <= m && e <= m) E = m;
			else if(s > m && e > m) S = m + 1;
			else break;
		}
		return Secret(dat[s][(S + E) / 2], dat[(S + E) / 2 + 1][e]);
	}
} S;

void Init(int N, int A[]) {
	S.ini(N, A);
}

int Query(int L, int R) {
	return S.get(L, R);
}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 189 ms 9204 KB Output isn't correct - number of calls to Secret by Init = 8194, maximum number of calls to Secret by Query = 1
2 Incorrect 176 ms 9204 KB Output isn't correct - number of calls to Secret by Init = 8194, maximum number of calls to Secret by Query = 1
3 Incorrect 179 ms 9204 KB Output isn't correct - number of calls to Secret by Init = 8194, maximum number of calls to Secret by Query = 1
4 Incorrect 619 ms 9204 KB Output isn't correct - number of calls to Secret by Init = 8194, maximum number of calls to Secret by Query = 1
5 Incorrect 616 ms 9204 KB Output isn't correct - number of calls to Secret by Init = 8194, maximum number of calls to Secret by Query = 1
6 Incorrect 636 ms 9204 KB Output isn't correct - number of calls to Secret by Init = 8194, maximum number of calls to Secret by Query = 1
7 Incorrect 636 ms 9204 KB Output isn't correct - number of calls to Secret by Init = 8194, maximum number of calls to Secret by Query = 1
8 Incorrect 626 ms 9204 KB Output isn't correct - number of calls to Secret by Init = 8194, maximum number of calls to Secret by Query = 1
9 Incorrect 629 ms 9204 KB Output isn't correct - number of calls to Secret by Init = 8194, maximum number of calls to Secret by Query = 1
10 Incorrect 616 ms 9204 KB Output isn't correct - number of calls to Secret by Init = 8194, maximum number of calls to Secret by Query = 1