답안 #522445

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
522445 2022-02-05T03:55:25 Z dongliu0426 비밀 (JOI14_secret) C++17
0 / 100
449 ms 4432 KB
#include "secret.h"

#define N	1000
#define L	9

int ll[N + 1], tt[L + 1][N];

void Init(int n, int *aa) {
	int i, j;

	for (i = 2; i <= n; i++)
		ll[i] = ll[i >> 1] + 1;
	for (i = 0; i < n; i++)
		tt[0][i] = aa[i];
	for (j = 1; 1 << j <= n; j++)
		for (i = 0; i + (1 << j) <= n; i++)
			tt[j][i] = Secret(tt[j - 1][i], tt[j - 1][i + (1 << j - 1)]);
}

int Query(int l, int r) {
	int d = ll[r - l + 1];

	return Secret(tt[d][l], tt[d][r - (1 << d) + 1]);
}

Compilation message

secret.cpp: In function 'void Init(int, int*)':
secret.cpp:17:58: warning: suggest parentheses around '-' inside '<<' [-Wparentheses]
   17 |    tt[j][i] = Secret(tt[j - 1][i], tt[j - 1][i + (1 << j - 1)]);
      |                                                        ~~^~~
# 결과 실행 시간 메모리 Grader output
1 Incorrect 118 ms 2444 KB Wrong Answer: Query(222, 254) - expected : 34031541, actual : 839935006.
2 Incorrect 136 ms 2464 KB Wrong Answer: Query(60, 375) - expected : 669221184, actual : 73044041.
3 Incorrect 112 ms 2444 KB Wrong Answer: Query(211, 401) - expected : 674373968, actual : 951413062.
4 Incorrect 425 ms 4384 KB Wrong Answer: Query(90, 497) - expected : 397934825, actual : 889372840.
5 Incorrect 418 ms 4432 KB Wrong Answer: Query(587, 915) - expected : 752404486, actual : 389074008.
6 Incorrect 425 ms 4308 KB Wrong Answer: Query(915, 915) - expected : 282904741, actual : 31281100.
7 Incorrect 431 ms 4292 KB Wrong Answer: Query(84, 976) - expected : 742463504, actual : 709920818.
8 Incorrect 449 ms 4340 KB Wrong Answer: Query(58, 987) - expected : 20022464, actual : 225603928.
9 Incorrect 419 ms 4368 KB Wrong Answer: Query(33, 967) - expected : 676869696, actual : 819205962.
10 Incorrect 433 ms 4316 KB Wrong Answer: Query(116, 961) - expected : 68487362, actual : 538241930.