# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
887376 | 2023-12-14T11:13:21 Z | salmon | Intercastellar (JOI22_ho_t1) | C++14 | 77 ms | 8532 KB |
#include <bits/stdc++.h> using namespace std; int N; int lst[200100]; int Q; long long int pre[200100]; long long int X; int main(){ scanf(" %d",&N); for(int i = 1; i <= N; i++){ scanf(" %d",&lst[i]); } pre[0] = 0; for(int i = 1; i <= N; i++){ pre[i] = pre[i - 1] + (1<<__builtin_ctz(lst[i])); } int it = 0; scanf(" %d",&Q); for(int i = 0; i < Q; i++){ scanf(" %lld",&X); while(X > pre[it]) it++; printf("%d\n",lst[it] / (pre[it] - pre[it -1]) ); } }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 2396 KB | Output is correct |
2 | Correct | 1 ms | 2396 KB | Output is correct |
3 | Correct | 20 ms | 3368 KB | Output is correct |
4 | Correct | 35 ms | 3932 KB | Output is correct |
5 | Correct | 47 ms | 4724 KB | Output is correct |
6 | Correct | 28 ms | 3676 KB | Output is correct |
7 | Correct | 47 ms | 4868 KB | Output is correct |
8 | Correct | 51 ms | 4948 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 2396 KB | Output is correct |
2 | Correct | 1 ms | 2396 KB | Output is correct |
3 | Correct | 1 ms | 2392 KB | Output is correct |
4 | Correct | 1 ms | 2396 KB | Output is correct |
5 | Correct | 1 ms | 2396 KB | Output is correct |
6 | Correct | 1 ms | 2396 KB | Output is correct |
7 | Correct | 1 ms | 2396 KB | Output is correct |
8 | Correct | 1 ms | 2392 KB | Output is correct |
9 | Correct | 1 ms | 2396 KB | Output is correct |
10 | Correct | 1 ms | 2396 KB | Output is correct |
11 | Correct | 1 ms | 2396 KB | Output is correct |
12 | Correct | 1 ms | 2560 KB | Output is correct |
13 | Correct | 1 ms | 2396 KB | Output is correct |
14 | Correct | 1 ms | 2396 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 2396 KB | Output is correct |
2 | Correct | 1 ms | 2396 KB | Output is correct |
3 | Correct | 20 ms | 3368 KB | Output is correct |
4 | Correct | 35 ms | 3932 KB | Output is correct |
5 | Correct | 47 ms | 4724 KB | Output is correct |
6 | Correct | 28 ms | 3676 KB | Output is correct |
7 | Correct | 47 ms | 4868 KB | Output is correct |
8 | Correct | 51 ms | 4948 KB | Output is correct |
9 | Correct | 1 ms | 2396 KB | Output is correct |
10 | Correct | 1 ms | 2396 KB | Output is correct |
11 | Correct | 1 ms | 2392 KB | Output is correct |
12 | Correct | 1 ms | 2396 KB | Output is correct |
13 | Correct | 1 ms | 2396 KB | Output is correct |
14 | Correct | 1 ms | 2396 KB | Output is correct |
15 | Correct | 1 ms | 2396 KB | Output is correct |
16 | Correct | 1 ms | 2392 KB | Output is correct |
17 | Correct | 1 ms | 2396 KB | Output is correct |
18 | Correct | 1 ms | 2396 KB | Output is correct |
19 | Correct | 1 ms | 2396 KB | Output is correct |
20 | Correct | 1 ms | 2560 KB | Output is correct |
21 | Correct | 1 ms | 2396 KB | Output is correct |
22 | Correct | 1 ms | 2396 KB | Output is correct |
23 | Correct | 26 ms | 4700 KB | Output is correct |
24 | Correct | 33 ms | 5300 KB | Output is correct |
25 | Correct | 62 ms | 8096 KB | Output is correct |
26 | Correct | 47 ms | 5856 KB | Output is correct |
27 | Correct | 39 ms | 5676 KB | Output is correct |
28 | Correct | 66 ms | 8532 KB | Output is correct |
29 | Correct | 61 ms | 7996 KB | Output is correct |
30 | Correct | 43 ms | 5460 KB | Output is correct |
31 | Correct | 77 ms | 8324 KB | Output is correct |