# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
104597 | 2019-04-08T10:05:50 Z | YottaByte | Bali Sculptures (APIO15_sculpture) | C++14 | 3 ms | 428 KB |
#include <bits/stdc++.h> using namespace std; #define int long long const int N = 21, inf = 1e15; int n, a, b, ans = inf, ar[N]; void calc(int mask) { int one = __builtin_popcount(mask) + 1; if(a <= one && one + 1 <= b) { int sum = 0, temp = 0; for(int i = 0; i < n; i++) { sum += ar[i]; if(mask >> i & 1) { temp |= sum; sum = 0; } } temp |= sum; if(ans > temp) { ans = temp; } } } main() { cin >> n >> a >> b; for(int i = 0; i < n; i++) { cin >> ar[i]; } for(int i = 0; i < (1 << n); i++) { calc(i); } cout << ans << endl; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 384 KB | Output is correct |
2 | Correct | 2 ms | 384 KB | Output is correct |
3 | Incorrect | 3 ms | 384 KB | Output isn't correct |
4 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 384 KB | Output is correct |
2 | Correct | 2 ms | 428 KB | Output is correct |
3 | Incorrect | 2 ms | 256 KB | Output isn't correct |
4 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 256 KB | Output is correct |
2 | Correct | 2 ms | 256 KB | Output is correct |
3 | Incorrect | 2 ms | 256 KB | Output isn't correct |
4 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 256 KB | Output is correct |
2 | Correct | 2 ms | 256 KB | Output is correct |
3 | Incorrect | 2 ms | 256 KB | Output isn't correct |
4 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 384 KB | Output is correct |
2 | Correct | 2 ms | 384 KB | Output is correct |
3 | Incorrect | 3 ms | 384 KB | Output isn't correct |
4 | Halted | 0 ms | 0 KB | - |