답안 #110273

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
110273 2019-05-10T12:44:21 Z _demon_ Bali Sculptures (APIO15_sculpture) C++14
0 / 100
1000 ms 512 KB
#include <bits/stdc++.h>
using namespace std;
long long n,a,b;
long long arr[29];
vector<int>vv;
long long bt(int id,vector<int>v){
    if(id==n){
        if(v.size()+1>b || v.size()+1<a) return 10000000009ll;
        bool done[29]={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;
        /*if(all==11){
            for(int i=0;i<v.size();i++){
                cout<<v[i]<<" ";
            }
            cout<<endl;
        }*/
        return all;
    }
    long long ans=10000000009ll;
    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:8:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         if(v.size()+1>b || v.size()+1<a) return 10000000009ll;
            ~~~~~~~~~~^~
sculpture.cpp:8:38: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         if(v.size()+1>b || v.size()+1<a) return 10000000009ll;
                            ~~~~~~~~~~^~
sculpture.cpp:10: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 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 3 ms 384 KB Output is correct
5 Correct 2 ms 256 KB Output is correct
6 Correct 9 ms 384 KB Output is correct
7 Correct 18 ms 384 KB Output is correct
8 Correct 123 ms 256 KB Output is correct
9 Correct 167 ms 384 KB Output is correct
10 Correct 130 ms 360 KB Output is correct
11 Correct 142 ms 376 KB Output is correct
12 Correct 155 ms 384 KB Output is correct
13 Correct 222 ms 256 KB Output is correct
14 Correct 2 ms 384 KB Output is correct
15 Incorrect 4 ms 512 KB Output isn't correct
16 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 384 KB Output is correct
4 Correct 2 ms 384 KB Output is correct
5 Correct 5 ms 384 KB Output is correct
6 Correct 11 ms 384 KB Output is correct
7 Correct 17 ms 256 KB Output is correct
8 Correct 126 ms 384 KB Output is correct
9 Correct 159 ms 256 KB Output is correct
10 Correct 123 ms 364 KB Output is correct
11 Correct 130 ms 384 KB Output is correct
12 Correct 161 ms 384 KB Output is correct
13 Correct 183 ms 384 KB Output is correct
14 Correct 3 ms 384 KB Output is correct
15 Incorrect 3 ms 384 KB Output isn't correct
16 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 2 ms 384 KB Output is correct
4 Correct 3 ms 256 KB Output is correct
5 Correct 3 ms 304 KB Output is correct
6 Correct 10 ms 384 KB Output is correct
7 Correct 32 ms 256 KB Output is correct
8 Correct 157 ms 384 KB Output is correct
9 Correct 151 ms 384 KB Output is correct
10 Correct 157 ms 360 KB Output is correct
11 Correct 154 ms 396 KB Output is correct
12 Correct 134 ms 384 KB Output is correct
13 Correct 261 ms 404 KB Output is correct
14 Correct 471 ms 504 KB Output is correct
15 Execution timed out 1065 ms 384 KB Time limit exceeded
16 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 3 ms 432 KB Output is correct
2 Correct 2 ms 384 KB Output is correct
3 Correct 2 ms 384 KB Output is correct
4 Correct 2 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 17 ms 256 KB Output is correct
8 Correct 123 ms 384 KB Output is correct
9 Correct 125 ms 384 KB Output is correct
10 Correct 125 ms 396 KB Output is correct
11 Correct 129 ms 504 KB Output is correct
12 Correct 131 ms 384 KB Output is correct
13 Correct 247 ms 396 KB Output is correct
14 Correct 3 ms 384 KB Output is correct
15 Incorrect 4 ms 256 KB Output isn't correct
16 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 384 KB Output is correct
2 Correct 2 ms 256 KB Output is correct
3 Correct 2 ms 384 KB Output is correct
4 Correct 3 ms 384 KB Output is correct
5 Correct 2 ms 256 KB Output is correct
6 Correct 10 ms 368 KB Output is correct
7 Correct 18 ms 384 KB Output is correct
8 Correct 127 ms 384 KB Output is correct
9 Correct 132 ms 504 KB Output is correct
10 Correct 152 ms 384 KB Output is correct
11 Correct 135 ms 256 KB Output is correct
12 Correct 187 ms 360 KB Output is correct
13 Correct 226 ms 384 KB Output is correct
14 Correct 2 ms 256 KB Output is correct
15 Correct 4 ms 256 KB Output is correct
16 Correct 4 ms 256 KB Output is correct
17 Correct 85 ms 384 KB Output is correct
18 Correct 159 ms 504 KB Output is correct
19 Incorrect 149 ms 396 KB Output isn't correct
20 Halted 0 ms 0 KB -