답안 #110282

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
110282 2019-05-10T13:09:40 Z _demon_ Bali Sculptures (APIO15_sculpture) C++14
9 / 100
1000 ms 512 KB
#include <bits/stdc++.h>
using namespace std;
long long n,a,b;
long long arr[59];
vector<int>vv;
long long bt(int id,vector<int>v){
  	if(v.size()+1>b) return 100000000000009ll;
    if(id==n-1){
        if(v.size()+1>b || v.size()+1<a) return 1000000000009ll;
        bool done[59]={0};
        for(int i=0;i<v.size();i++){
            done[v[i]]=1;
        }
        long long all=0;
        long long sum=0;
        for(int i=0;i<n;i++){
            sum+=arr[i];
            if(done[i]){
                all|=sum;
                sum=0;
            }
        }
        all|=sum;
        return all;
    }
    long long ans=1000000000009ll;
    ans=min(ans,bt(id+1,v));
    v.push_back(id);
    ans=min(ans,bt(id+1,v));
    return ans;
}
int main(){
 cin>>n>>a>>b;
    for(int i=0;i<n;i++)cin>>arr[i];
    cout<<bt(0,vv)<<endl;
}

Compilation message

sculpture.cpp: In function 'long long int bt(int, std::vector<int>)':
sculpture.cpp:7:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
    if(v.size()+1>b) return 100000000000009ll;
       ~~~~~~~~~~^~
sculpture.cpp:9:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         if(v.size()+1>b || v.size()+1<a) return 1000000000009ll;
            ~~~~~~~~~~^~
sculpture.cpp:9:38: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         if(v.size()+1>b || v.size()+1<a) return 1000000000009ll;
                            ~~~~~~~~~~^~
sculpture.cpp:11:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         for(int i=0;i<v.size();i++){
                     ~^~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 256 KB Output is correct
2 Correct 2 ms 384 KB Output is correct
3 Correct 3 ms 384 KB Output is correct
4 Correct 3 ms 256 KB Output is correct
5 Correct 2 ms 256 KB Output is correct
6 Correct 6 ms 256 KB Output is correct
7 Correct 2 ms 384 KB Output is correct
8 Correct 2 ms 384 KB Output is correct
9 Correct 3 ms 384 KB Output is correct
10 Correct 2 ms 256 KB Output is correct
11 Correct 2 ms 384 KB Output is correct
12 Correct 3 ms 384 KB Output is correct
13 Correct 101 ms 512 KB Output is correct
14 Correct 2 ms 384 KB Output is correct
15 Correct 2 ms 384 KB Output is correct
16 Correct 2 ms 384 KB Output is correct
17 Correct 3 ms 384 KB Output is correct
18 Correct 2 ms 384 KB Output is correct
19 Correct 4 ms 256 KB Output is correct
20 Correct 2 ms 256 KB Output is correct
21 Correct 16 ms 384 KB Output is correct
22 Correct 24 ms 384 KB Output is correct
23 Correct 20 ms 504 KB Output is correct
24 Correct 2 ms 256 KB Output is correct
25 Correct 22 ms 460 KB Output is correct
26 Correct 119 ms 384 KB Output is correct
27 Correct 2 ms 384 KB Output is correct
28 Correct 2 ms 256 KB Output is correct
29 Correct 3 ms 384 KB Output is correct
30 Correct 2 ms 256 KB Output is correct
31 Correct 33 ms 384 KB Output is correct
32 Correct 2 ms 256 KB Output is correct
33 Correct 92 ms 384 KB Output is correct
34 Correct 131 ms 476 KB Output is correct
35 Correct 2 ms 256 KB Output is correct
36 Correct 124 ms 476 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 384 KB Output is correct
2 Correct 2 ms 256 KB Output is correct
3 Correct 2 ms 256 KB Output is correct
4 Correct 2 ms 384 KB Output is correct
5 Correct 2 ms 256 KB Output is correct
6 Correct 9 ms 364 KB Output is correct
7 Correct 2 ms 256 KB Output is correct
8 Correct 2 ms 384 KB Output is correct
9 Correct 2 ms 384 KB Output is correct
10 Correct 2 ms 460 KB Output is correct
11 Correct 3 ms 256 KB Output is correct
12 Correct 2 ms 384 KB Output is correct
13 Correct 120 ms 256 KB Output is correct
14 Correct 2 ms 384 KB Output is correct
15 Correct 2 ms 256 KB Output is correct
16 Correct 2 ms 384 KB Output is correct
17 Correct 2 ms 256 KB Output is correct
18 Correct 2 ms 384 KB Output is correct
19 Correct 6 ms 384 KB Output is correct
20 Correct 2 ms 384 KB Output is correct
21 Correct 20 ms 384 KB Output is correct
22 Correct 18 ms 256 KB Output is correct
23 Correct 19 ms 384 KB Output is correct
24 Correct 3 ms 256 KB Output is correct
25 Correct 21 ms 384 KB Output is correct
26 Correct 116 ms 384 KB Output is correct
27 Correct 235 ms 356 KB Output is correct
28 Correct 893 ms 504 KB Output is correct
29 Correct 74 ms 384 KB Output is correct
30 Execution timed out 1080 ms 252 KB Time limit exceeded
31 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 3 ms 384 KB Output is correct
2 Correct 2 ms 384 KB Output is correct
3 Correct 3 ms 384 KB Output is correct
4 Correct 3 ms 384 KB Output is correct
5 Correct 3 ms 384 KB Output is correct
6 Correct 8 ms 384 KB Output is correct
7 Correct 3 ms 356 KB Output is correct
8 Correct 2 ms 256 KB Output is correct
9 Correct 3 ms 256 KB Output is correct
10 Correct 2 ms 384 KB Output is correct
11 Correct 2 ms 384 KB Output is correct
12 Correct 3 ms 384 KB Output is correct
13 Correct 122 ms 384 KB Output is correct
14 Correct 243 ms 364 KB Output is correct
15 Correct 945 ms 384 KB Output is correct
16 Correct 77 ms 384 KB Output is correct
17 Execution timed out 1072 ms 128 KB Time limit exceeded
18 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 3 ms 384 KB Output is correct
2 Correct 2 ms 384 KB Output is correct
3 Correct 2 ms 256 KB Output is correct
4 Correct 3 ms 384 KB Output is correct
5 Correct 2 ms 256 KB Output is correct
6 Correct 6 ms 256 KB Output is correct
7 Correct 2 ms 384 KB Output is correct
8 Correct 2 ms 256 KB Output is correct
9 Correct 3 ms 384 KB Output is correct
10 Correct 4 ms 384 KB Output is correct
11 Correct 2 ms 384 KB Output is correct
12 Correct 1 ms 256 KB Output is correct
13 Correct 178 ms 384 KB Output is correct
14 Correct 3 ms 384 KB Output is correct
15 Correct 3 ms 384 KB Output is correct
16 Correct 3 ms 384 KB Output is correct
17 Correct 4 ms 256 KB Output is correct
18 Correct 2 ms 384 KB Output is correct
19 Correct 4 ms 256 KB Output is correct
20 Correct 2 ms 384 KB Output is correct
21 Correct 18 ms 384 KB Output is correct
22 Correct 16 ms 384 KB Output is correct
23 Correct 16 ms 256 KB Output is correct
24 Correct 3 ms 384 KB Output is correct
25 Correct 17 ms 384 KB Output is correct
26 Correct 103 ms 256 KB Output is correct
27 Correct 2 ms 428 KB Output is correct
28 Correct 2 ms 256 KB Output is correct
29 Correct 3 ms 384 KB Output is correct
30 Correct 3 ms 384 KB Output is correct
31 Correct 30 ms 504 KB Output is correct
32 Correct 2 ms 384 KB Output is correct
33 Correct 100 ms 256 KB Output is correct
34 Correct 156 ms 256 KB Output is correct
35 Correct 3 ms 256 KB Output is correct
36 Correct 131 ms 352 KB Output is correct
37 Correct 204 ms 384 KB Output is correct
38 Correct 930 ms 504 KB Output is correct
39 Correct 64 ms 504 KB Output is correct
40 Execution timed out 1070 ms 384 KB Time limit exceeded
41 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 256 KB Output is correct
2 Correct 2 ms 384 KB Output is correct
3 Correct 4 ms 256 KB Output is correct
4 Correct 2 ms 256 KB Output is correct
5 Correct 3 ms 384 KB Output is correct
6 Correct 7 ms 256 KB Output is correct
7 Correct 2 ms 384 KB Output is correct
8 Correct 2 ms 384 KB Output is correct
9 Correct 2 ms 256 KB Output is correct
10 Correct 3 ms 384 KB Output is correct
11 Correct 2 ms 256 KB Output is correct
12 Correct 3 ms 384 KB Output is correct
13 Correct 104 ms 256 KB Output is correct
14 Correct 2 ms 384 KB Output is correct
15 Correct 3 ms 384 KB Output is correct
16 Correct 3 ms 384 KB Output is correct
17 Correct 2 ms 256 KB Output is correct
18 Correct 20 ms 396 KB Output is correct
19 Correct 3 ms 384 KB Output is correct
20 Correct 141 ms 384 KB Output is correct
21 Correct 121 ms 384 KB Output is correct
22 Correct 3 ms 384 KB Output is correct
23 Correct 123 ms 384 KB Output is correct
24 Correct 265 ms 384 KB Output is correct
25 Correct 892 ms 356 KB Output is correct
26 Correct 73 ms 380 KB Output is correct
27 Execution timed out 1085 ms 256 KB Time limit exceeded
28 Halted 0 ms 0 KB -