답안 #235609

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
235609 2020-05-28T20:01:27 Z Blagojce 비밀 (JOI14_secret) C++11
0 / 100
767 ms 524292 KB
#include <bits/stdc++.h> 
#define fr(i, n, m) for(int i = (n); i < (m); i ++)
#define pb push_back
#define st first
#define nd second
#define pq priority_queue
#define all(x) begin(x), end(x)
#include <time.h>
#include <cmath>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
const ll inf = 1e18;
const ll mod = 1000000007;
const ld eps = 1e-13;
const ld pi  = 3.14159265359;
 
mt19937 _rand(time(NULL));
clock_t timer = clock();
const int mxn = 5e5 + 5;

#include "secret.h"


int seg[mxn];
int n;
int a[mxn];
void build(int k, int l, int r){
	if(l == r){
		seg[k] = a[l];
		return;
	}
	int mid = (l + r) / 2;
	build(k * 2, l, mid);
	build(k * 2 + 1, mid + 1, r);
	seg[k] = Secret(seg[k * 2], seg[k * 2 + 1]);
}
vector<int> v;
void query(int k, int l, int r, int x, int y){
	if(y < l && r < x) return;
	
	if(x <= l && r <= y){
		v.pb(seg[k]);
		return;
	}
	int mid = (l + r) / 2;
	query(k * 2, l, mid, x, y);
	query(k * 2 + 1, mid + 1, r, x, y);
}





void Init(int N, int A[]) {
	n = N;
	fr(i, 0, N){
		a[i] = A[i];
	}
	build(1, 0, n-1);
}

int Query(int L, int R){
	v.clear();
	query(1, 0, n - 1, L, R);
	int ans = v[0];
	fr(i, 1, (int)v.size()){
		ans = Secret(ans, v[i]);
	}
	
	return ans;
}
# 결과 실행 시간 메모리 Grader output
1 Runtime error 412 ms 524292 KB Execution killed with signal 9 (could be triggered by violating memory limits)
2 Runtime error 407 ms 524292 KB Execution killed with signal 9 (could be triggered by violating memory limits)
3 Runtime error 405 ms 524292 KB Execution killed with signal 9 (could be triggered by violating memory limits)
4 Runtime error 755 ms 524292 KB Execution killed with signal 9 (could be triggered by violating memory limits)
5 Runtime error 767 ms 524292 KB Execution killed with signal 9 (could be triggered by violating memory limits)
6 Runtime error 766 ms 524292 KB Execution killed with signal 9 (could be triggered by violating memory limits)
7 Runtime error 766 ms 524292 KB Execution killed with signal 9 (could be triggered by violating memory limits)
8 Runtime error 754 ms 524292 KB Execution killed with signal 9 (could be triggered by violating memory limits)
9 Runtime error 751 ms 524292 KB Execution killed with signal 9 (could be triggered by violating memory limits)
10 Runtime error 765 ms 524292 KB Execution killed with signal 9 (could be triggered by violating memory limits)