답안 #749023

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
749023 2023-05-27T09:14:05 Z mariowong 비밀 (JOI14_secret) C++14
0 / 100
486 ms 4704 KB
#include "secret.h"
#include <bits/stdc++.h>
using namespace std;
map <pair<int,int>,pair<int,bool>  > m;
void ask(int l,int r,int A[]){
	int mid=(l+r)/2;
	if (l != r){
		ask(l,mid,A);
		ask(mid+1,r,A);
	} 
	int val=A[r];
	for (int i=r-1;i>=l;i--){
		if (!m[{i,r}].second){
			val=Secret(A[i],val);
			m[{i,r}]={val,true};
		} 
		else
		val=m[{i,r}].first;
	}
}
void Init(int N, int A[]) {
  	m.clear();
  	int mid=(N-1)/2;
  	for (int i=0;i<N;i++) m[{i,i}]={A[i],true};
	ask(0,mid,A);
	ask(mid+1,N-1,A);
}

int Query(int L, int R) {
	if (m[{L,R}].second) return m[{L,R}].first;
	for (int i=L;i<R;i++){
		if (m[{L,i}].second && m[{i+1,R}].second) return Secret(m[{L,i}].first,m[{i+1,R}].first);
	}
  return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 126 ms 2520 KB Wrong Answer: Query(222, 254) - expected : 34031541, actual : 0.
2 Incorrect 124 ms 2476 KB Wrong Answer: Query(60, 375) - expected : 669221184, actual : 0.
3 Incorrect 165 ms 2492 KB Wrong Answer: Query(211, 401) - expected : 674373968, actual : 0.
4 Incorrect 474 ms 4600 KB Wrong Answer: Query(90, 497) - expected : 397934825, actual : 0.
5 Incorrect 486 ms 4552 KB Wrong Answer: Query(587, 915) - expected : 752404486, actual : 0.
6 Incorrect 460 ms 4592 KB Wrong Answer: Query(738, 741) - expected : 983692994, actual : 0.
7 Incorrect 478 ms 4632 KB Wrong Answer: Query(84, 976) - expected : 742463504, actual : 0.
8 Incorrect 432 ms 4704 KB Wrong Answer: Query(58, 987) - expected : 20022464, actual : 0.
9 Incorrect 429 ms 4652 KB Wrong Answer: Query(33, 967) - expected : 676869696, actual : 0.
10 Incorrect 430 ms 4632 KB Wrong Answer: Query(116, 961) - expected : 68487362, actual : 0.