답안 #1019815

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1019815 2024-07-11T09:14:36 Z KasymK Bali Sculptures (APIO15_sculpture) C++17
0 / 100
1000 ms 440 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(){
    int n, a, b;
    scanf("%d%d%d", &n, &a, &b);
    vector<int> v(n);
    for(int &i : v)
        scanf("%d", &i);
    ll ans = INT_MAX;
    for(int mk = 0; mk < (1<<n); ++mk){
        ll sm = 0, cur = 0;
        int x = 1;
        for(int 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("%d%d%d", &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("%d", &i);
      |         ~~~~~^~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 0 ms 344 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 9 ms 348 KB Output is correct
8 Correct 72 ms 348 KB Output is correct
9 Correct 57 ms 344 KB Output is correct
10 Correct 56 ms 408 KB Output is correct
11 Correct 60 ms 344 KB Output is correct
12 Correct 67 ms 348 KB Output is correct
13 Correct 57 ms 344 KB Output is correct
14 Correct 0 ms 344 KB Output is correct
15 Incorrect 0 ms 344 KB Output isn't correct
16 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 1 ms 344 KB Output is correct
4 Correct 1 ms 348 KB Output is correct
5 Correct 1 ms 344 KB Output is correct
6 Correct 2 ms 348 KB Output is correct
7 Correct 9 ms 428 KB Output is correct
8 Correct 56 ms 344 KB Output is correct
9 Correct 56 ms 344 KB Output is correct
10 Correct 70 ms 348 KB Output is correct
11 Correct 56 ms 348 KB Output is correct
12 Correct 56 ms 348 KB Output is correct
13 Correct 57 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 1 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 1 ms 348 KB Output is correct
6 Correct 2 ms 348 KB Output is correct
7 Correct 8 ms 440 KB Output is correct
8 Correct 64 ms 428 KB Output is correct
9 Correct 66 ms 344 KB Output is correct
10 Correct 66 ms 416 KB Output is correct
11 Correct 67 ms 348 KB Output is correct
12 Correct 57 ms 348 KB Output is correct
13 Correct 72 ms 412 KB Output is correct
14 Correct 114 ms 412 KB Output is correct
15 Execution timed out 1018 ms 344 KB Time limit exceeded
16 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 428 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 1 ms 344 KB Output is correct
5 Correct 1 ms 348 KB Output is correct
6 Correct 2 ms 348 KB Output is correct
7 Correct 9 ms 348 KB Output is correct
8 Correct 67 ms 348 KB Output is correct
9 Correct 73 ms 416 KB Output is correct
10 Correct 58 ms 344 KB Output is correct
11 Correct 60 ms 416 KB Output is correct
12 Correct 58 ms 408 KB Output is correct
13 Correct 58 ms 416 KB Output is correct
14 Correct 1 ms 344 KB Output is correct
15 Incorrect 0 ms 348 KB Output isn't correct
16 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 440 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 1 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 9 ms 432 KB Output is correct
8 Correct 63 ms 408 KB Output is correct
9 Correct 61 ms 344 KB Output is correct
10 Correct 59 ms 344 KB Output is correct
11 Correct 59 ms 412 KB Output is correct
12 Correct 61 ms 412 KB Output is correct
13 Correct 58 ms 344 KB Output is correct
14 Correct 1 ms 348 KB Output is correct
15 Correct 1 ms 348 KB Output is correct
16 Correct 1 ms 348 KB Output is correct
17 Incorrect 30 ms 408 KB Output isn't correct
18 Halted 0 ms 0 KB -