# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
40734 | 2018-02-07T16:49:30 Z | bogdan10bos | Bali Sculptures (APIO15_sculpture) | C++14 | 114 ms | 1128 KB |
#include <bits/stdc++.h> using namespace std; //#define FILE_IO typedef long long LL; int N, A, B; int v[2005]; LL s[2005]; LL ans; int dp1[2005]; bool can(int b) { LL pw = (1LL << b); if(A == 1) { dp1[0] = 0; for(int i = 1; i <= N; i++) { dp1[i] = N + 1; for(int j = 0; j < i; j++) if( ( (s[i] - s[j]) & (~ans) ) < pw ) dp1[i] = min(dp1[i], dp1[j] + 1); } return (dp1[N] <= B); } return true; } int main() { #ifdef FILE_IO freopen("1.in", "r", stdin); freopen("1.out", "w", stdout); #endif scanf("%d%d%d", &N, &A, &B); for(int i = 1; i <= N; i++) scanf("%d", &v[i]), s[i] = s[i - 1] + v[i]; ans = 0; for(int b = 41; b >= 0; b--) if( !can(b) ) ans ^= (1LL << b); printf("%lld\n", ans); return 0; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 248 KB | Output is correct |
2 | Correct | 2 ms | 352 KB | Output is correct |
3 | Correct | 1 ms | 432 KB | Output is correct |
4 | Correct | 2 ms | 500 KB | Output is correct |
5 | Correct | 1 ms | 500 KB | Output is correct |
6 | Correct | 1 ms | 512 KB | Output is correct |
7 | Correct | 1 ms | 532 KB | Output is correct |
8 | Correct | 1 ms | 532 KB | Output is correct |
9 | Correct | 1 ms | 532 KB | Output is correct |
10 | Correct | 1 ms | 532 KB | Output is correct |
11 | Correct | 1 ms | 532 KB | Output is correct |
12 | Correct | 1 ms | 532 KB | Output is correct |
13 | Correct | 1 ms | 532 KB | Output is correct |
14 | Incorrect | 1 ms | 552 KB | Output isn't correct |
15 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 552 KB | Output is correct |
2 | Correct | 2 ms | 600 KB | Output is correct |
3 | Correct | 1 ms | 600 KB | Output is correct |
4 | Correct | 1 ms | 600 KB | Output is correct |
5 | Correct | 1 ms | 600 KB | Output is correct |
6 | Correct | 1 ms | 600 KB | Output is correct |
7 | Correct | 2 ms | 600 KB | Output is correct |
8 | Correct | 2 ms | 600 KB | Output is correct |
9 | Correct | 2 ms | 600 KB | Output is correct |
10 | Correct | 1 ms | 600 KB | Output is correct |
11 | Correct | 1 ms | 600 KB | Output is correct |
12 | Correct | 2 ms | 600 KB | Output is correct |
13 | Correct | 2 ms | 600 KB | Output is correct |
14 | Incorrect | 2 ms | 600 KB | Output isn't correct |
15 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 600 KB | Output is correct |
2 | Correct | 2 ms | 600 KB | Output is correct |
3 | Correct | 2 ms | 600 KB | Output is correct |
4 | Correct | 1 ms | 600 KB | Output is correct |
5 | Correct | 2 ms | 600 KB | Output is correct |
6 | Correct | 2 ms | 600 KB | Output is correct |
7 | Correct | 2 ms | 600 KB | Output is correct |
8 | Correct | 2 ms | 620 KB | Output is correct |
9 | Correct | 2 ms | 620 KB | Output is correct |
10 | Correct | 1 ms | 620 KB | Output is correct |
11 | Correct | 2 ms | 620 KB | Output is correct |
12 | Correct | 1 ms | 620 KB | Output is correct |
13 | Correct | 1 ms | 620 KB | Output is correct |
14 | Correct | 2 ms | 620 KB | Output is correct |
15 | Correct | 2 ms | 620 KB | Output is correct |
16 | Correct | 2 ms | 620 KB | Output is correct |
17 | Correct | 2 ms | 620 KB | Output is correct |
18 | Correct | 2 ms | 620 KB | Output is correct |
19 | Correct | 2 ms | 620 KB | Output is correct |
20 | Correct | 2 ms | 620 KB | Output is correct |
21 | Correct | 1 ms | 620 KB | Output is correct |
22 | Correct | 2 ms | 620 KB | Output is correct |
23 | Correct | 2 ms | 620 KB | Output is correct |
24 | Correct | 2 ms | 620 KB | Output is correct |
25 | Correct | 2 ms | 620 KB | Output is correct |
26 | Correct | 2 ms | 620 KB | Output is correct |
27 | Correct | 2 ms | 620 KB | Output is correct |
28 | Correct | 2 ms | 620 KB | Output is correct |
29 | Correct | 2 ms | 620 KB | Output is correct |
30 | Correct | 2 ms | 620 KB | Output is correct |
31 | Correct | 2 ms | 620 KB | Output is correct |
32 | Correct | 2 ms | 620 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 620 KB | Output is correct |
2 | Correct | 2 ms | 620 KB | Output is correct |
3 | Correct | 1 ms | 620 KB | Output is correct |
4 | Correct | 1 ms | 620 KB | Output is correct |
5 | Correct | 1 ms | 620 KB | Output is correct |
6 | Correct | 2 ms | 620 KB | Output is correct |
7 | Correct | 2 ms | 620 KB | Output is correct |
8 | Correct | 1 ms | 620 KB | Output is correct |
9 | Correct | 2 ms | 620 KB | Output is correct |
10 | Correct | 1 ms | 620 KB | Output is correct |
11 | Correct | 1 ms | 620 KB | Output is correct |
12 | Correct | 2 ms | 620 KB | Output is correct |
13 | Correct | 2 ms | 620 KB | Output is correct |
14 | Incorrect | 2 ms | 620 KB | Output isn't correct |
15 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 620 KB | Output is correct |
2 | Correct | 2 ms | 620 KB | Output is correct |
3 | Correct | 2 ms | 620 KB | Output is correct |
4 | Correct | 2 ms | 620 KB | Output is correct |
5 | Correct | 1 ms | 620 KB | Output is correct |
6 | Correct | 2 ms | 620 KB | Output is correct |
7 | Correct | 2 ms | 620 KB | Output is correct |
8 | Correct | 2 ms | 620 KB | Output is correct |
9 | Correct | 1 ms | 620 KB | Output is correct |
10 | Correct | 2 ms | 620 KB | Output is correct |
11 | Correct | 1 ms | 620 KB | Output is correct |
12 | Correct | 1 ms | 620 KB | Output is correct |
13 | Correct | 1 ms | 620 KB | Output is correct |
14 | Correct | 1 ms | 620 KB | Output is correct |
15 | Correct | 1 ms | 620 KB | Output is correct |
16 | Correct | 1 ms | 620 KB | Output is correct |
17 | Correct | 1 ms | 620 KB | Output is correct |
18 | Correct | 2 ms | 620 KB | Output is correct |
19 | Correct | 1 ms | 620 KB | Output is correct |
20 | Correct | 1 ms | 620 KB | Output is correct |
21 | Correct | 1 ms | 620 KB | Output is correct |
22 | Correct | 1 ms | 620 KB | Output is correct |
23 | Correct | 2 ms | 620 KB | Output is correct |
24 | Correct | 1 ms | 620 KB | Output is correct |
25 | Correct | 1 ms | 620 KB | Output is correct |
26 | Correct | 1 ms | 620 KB | Output is correct |
27 | Correct | 1 ms | 620 KB | Output is correct |
28 | Correct | 2 ms | 620 KB | Output is correct |
29 | Correct | 1 ms | 620 KB | Output is correct |
30 | Correct | 2 ms | 620 KB | Output is correct |
31 | Correct | 1 ms | 620 KB | Output is correct |
32 | Correct | 1 ms | 620 KB | Output is correct |
33 | Correct | 2 ms | 620 KB | Output is correct |
34 | Correct | 1 ms | 620 KB | Output is correct |
35 | Correct | 2 ms | 620 KB | Output is correct |
36 | Correct | 2 ms | 620 KB | Output is correct |
37 | Correct | 2 ms | 620 KB | Output is correct |
38 | Correct | 2 ms | 620 KB | Output is correct |
39 | Correct | 2 ms | 620 KB | Output is correct |
40 | Correct | 2 ms | 620 KB | Output is correct |
41 | Correct | 2 ms | 620 KB | Output is correct |
42 | Correct | 2 ms | 620 KB | Output is correct |
43 | Correct | 2 ms | 620 KB | Output is correct |
44 | Correct | 2 ms | 624 KB | Output is correct |
45 | Correct | 2 ms | 656 KB | Output is correct |
46 | Correct | 2 ms | 696 KB | Output is correct |
47 | Correct | 2 ms | 728 KB | Output is correct |
48 | Correct | 2 ms | 728 KB | Output is correct |
49 | Correct | 2 ms | 728 KB | Output is correct |
50 | Correct | 2 ms | 728 KB | Output is correct |
51 | Correct | 2 ms | 744 KB | Output is correct |
52 | Correct | 10 ms | 876 KB | Output is correct |
53 | Correct | 16 ms | 876 KB | Output is correct |
54 | Correct | 30 ms | 876 KB | Output is correct |
55 | Correct | 29 ms | 876 KB | Output is correct |
56 | Correct | 95 ms | 876 KB | Output is correct |
57 | Correct | 101 ms | 960 KB | Output is correct |
58 | Correct | 89 ms | 960 KB | Output is correct |
59 | Correct | 114 ms | 960 KB | Output is correct |
60 | Correct | 99 ms | 960 KB | Output is correct |
61 | Correct | 2 ms | 960 KB | Output is correct |
62 | Correct | 17 ms | 960 KB | Output is correct |
63 | Correct | 34 ms | 960 KB | Output is correct |
64 | Correct | 32 ms | 972 KB | Output is correct |
65 | Correct | 50 ms | 988 KB | Output is correct |
66 | Correct | 72 ms | 1128 KB | Output is correct |
67 | Correct | 95 ms | 1128 KB | Output is correct |
68 | Correct | 108 ms | 1128 KB | Output is correct |
69 | Correct | 92 ms | 1128 KB | Output is correct |