| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 | 
|---|---|---|---|---|---|---|---|
| 1096842 | hihihihaw | Bali Sculptures (APIO15_sculpture) | C++17 | 26 ms | 1884 KiB | 
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#pragma GCC optimize("O3,unroll-loops")    
#include <bits/stdc++.h>
using namespace std;
 
#define int long long
#define pb push_back
#define pii pair<int,int>
#define sz(v) (int)v.size()
#define fi first
#define se second
#define INF 1223372036854775807
#define MOD  1000000007
#define cint(x) int x;cin>>x;
#define cinarr(a,n) int a[n];for (int i=0;i<n;i++) cin>>a[i];
#define coutarr(a) for (auto d:a)cout<<d<<" "; cout<<endl;
#define coutarrD(a) for (auto d:a) cout<<d.fi<<","<<d.se<<" "; cout<<endl;
#define BERKAY_TUP ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define endl '\n'
#define ld long double
#define mid (start+end)/2
#define vvi vector<vector<int>>
int t=1;
int interactive=0;
int usaco=0;
int testCase=0;
int dp[101][2048];
void solve(){
    int n,a,b;
    cin>>n>>a>>b;
    cinarr(z,n);
    for (int i=0;i<=n;i++){
        for (int j=0;j<2048;j++){
            dp[i][j]=INF;
        }
    }
    dp[0][0]=0;
    for (int i=0;i<n;i++){
        for (int j=0;j<2048;j++){
            int x=0;
            for (int l=i+1;l<=n;l++){
                x+=z[l-1];
                dp[l][j|x]=min(dp[l][j|x],dp[i][j]+1);
            }
        }
    }
    int ans=INF;
    for (int j=0;j<2048;j++){
        if (dp[n][j]<=b){
            ans=min(ans,j);
            //cout<<j<<" "<<dp[n][j]<<endl;
        }
    }
    cout<<ans<<endl;
    
}
 
 
 
 
 
 
 
 
int32_t main(){
    
    BERKAY_TUP;
    if (usaco){
        freopen("runaway.in", "r", stdin);
        freopen("runaway.out", "w", stdout);
    }
    if (!interactive){
    #ifdef Local
        freopen("in.txt", "r", stdin);
        freopen("out.txt", "w", stdout);
        //freopen("wormsort.out", "w", stdout);
    #endif
    }
    if (t==1) solve();
    else{
        cin>>t;
        while (t--){testCase++;solve();}
    }
    
        
    return 0;
}
컴파일 시 표준 에러 (stderr) 메시지
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
