제출 #342212

#제출 시각아이디문제언어결과실행 시간메모리
342212blue비밀 (JOI14_secret)C++11
30 / 100
588 ms4600 KiB
#include "secret.h" using namespace std; int res[1000][11]; void Init(int N, int A[]) { for(int i = 0; i < N; i++) res[i][0] = A[i]; for(int exp = 1; (1 << exp) <= N; exp++) { for(int i = 0; i + (1 << exp) - 1 < N; i++) { res[i][exp] = Secret(res[i][exp - 1], res[i + (1 << (exp-1))][exp - 1]); } } } int Query(int L, int R) { int query_res = -1; int s = (R - L + 1); for(int exp = 10; exp >= 0; exp--) { if((R-L+1) & (1 << exp)) { if(query_res == -1) query_res = res[L][exp]; else query_res = Secret(query_res, res[L][exp]); L = L + (1 << exp); } } return query_res; }

컴파일 시 표준 에러 (stderr) 메시지

secret.cpp: In function 'int Query(int, int)':
secret.cpp:22:9: warning: unused variable 's' [-Wunused-variable]
   22 |     int s = (R - L + 1);
      |         ^
#Verdict Execution timeMemoryGrader output
Fetching results...