답안 #1019824

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1019824 2024-07-11T09:17:43 Z KasymK Bali Sculptures (APIO15_sculpture) C++17
0 / 100
1000 ms 600 KB
#include "bits/stdc++.h"
using namespace std;
#define pb push_back
#define ll long long
#define ff first
#define ss second
#define all(v) v.begin(), v.end()

int main(){
    ll n, a, b;
    scanf("%lld%lld%lld", &n, &a, &b);
    vector<ll> v(n);
    for(ll &i : v)
        scanf("%lld", &i);
    ll ans = 1e18;
    for(ll mk = 0; mk < (1ll<<n); ++mk){
        ll sm = 0, cur = 0, x = 1;
        for(ll i = 0; i < n; ++i){
            sm += v[i];
            if(mk>>i&1)
                cur |= sm, sm = 0, x++;
        }
        cur |= sm;
        if(a <= x and x <= b)
            ans = min(ans, cur);
    }
    printf("%lld", ans);
    return 0;
}

Compilation message

sculpture.cpp: In function 'int main()':
sculpture.cpp:11:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   11 |     scanf("%lld%lld%lld", &n, &a, &b);
      |     ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
sculpture.cpp:14:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   14 |         scanf("%lld", &i);
      |         ~~~~~^~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 344 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 2 ms 348 KB Output is correct
7 Correct 7 ms 436 KB Output is correct
8 Correct 54 ms 348 KB Output is correct
9 Correct 56 ms 348 KB Output is correct
10 Correct 55 ms 348 KB Output is correct
11 Correct 59 ms 344 KB Output is correct
12 Correct 62 ms 600 KB Output is correct
13 Correct 55 ms 348 KB Output is correct
14 Correct 0 ms 348 KB Output is correct
15 Incorrect 0 ms 436 KB Output isn't correct
16 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 436 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 2 ms 348 KB Output is correct
7 Correct 7 ms 348 KB Output is correct
8 Correct 54 ms 348 KB Output is correct
9 Correct 54 ms 348 KB Output is correct
10 Correct 54 ms 348 KB Output is correct
11 Correct 54 ms 412 KB Output is correct
12 Correct 54 ms 344 KB Output is correct
13 Correct 55 ms 348 KB Output is correct
14 Correct 0 ms 348 KB Output is correct
15 Incorrect 0 ms 348 KB Output isn't correct
16 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 2 ms 348 KB Output is correct
7 Correct 7 ms 344 KB Output is correct
8 Correct 54 ms 412 KB Output is correct
9 Correct 54 ms 344 KB Output is correct
10 Correct 57 ms 412 KB Output is correct
11 Correct 54 ms 348 KB Output is correct
12 Correct 54 ms 348 KB Output is correct
13 Correct 55 ms 348 KB Output is correct
14 Correct 114 ms 348 KB Output is correct
15 Execution timed out 1010 ms 344 KB Time limit exceeded
16 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 1 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 2 ms 348 KB Output is correct
7 Correct 7 ms 344 KB Output is correct
8 Correct 54 ms 348 KB Output is correct
9 Correct 54 ms 344 KB Output is correct
10 Correct 54 ms 344 KB Output is correct
11 Correct 54 ms 412 KB Output is correct
12 Correct 54 ms 412 KB Output is correct
13 Correct 55 ms 348 KB Output is correct
14 Correct 1 ms 348 KB Output is correct
15 Incorrect 0 ms 348 KB Output isn't correct
16 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 2 ms 348 KB Output is correct
7 Correct 7 ms 344 KB Output is correct
8 Correct 54 ms 348 KB Output is correct
9 Correct 54 ms 344 KB Output is correct
10 Correct 54 ms 344 KB Output is correct
11 Correct 54 ms 344 KB Output is correct
12 Correct 54 ms 348 KB Output is correct
13 Correct 55 ms 348 KB Output is correct
14 Correct 0 ms 348 KB Output is correct
15 Correct 0 ms 344 KB Output is correct
16 Correct 1 ms 348 KB Output is correct
17 Correct 28 ms 348 KB Output is correct
18 Correct 51 ms 348 KB Output is correct
19 Correct 55 ms 348 KB Output is correct
20 Correct 51 ms 344 KB Output is correct
21 Correct 61 ms 416 KB Output is correct
22 Correct 61 ms 344 KB Output is correct
23 Correct 60 ms 348 KB Output is correct
24 Correct 113 ms 348 KB Output is correct
25 Execution timed out 1027 ms 344 KB Time limit exceeded
26 Halted 0 ms 0 KB -