# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
111023 | 2019-05-13T14:47:12 Z | _demon_ | Bali Sculptures (APIO15_sculpture) | C++14 | 3 ms | 428 KB |
#include <bits/stdc++.h> using namespace std; int n,x,y; int a[109]; int inf=1000000009; int dp[109][2100]; void memo(){ for(int i=0;i<=n;i++){ for(int j=0;j<=2050;j++){ dp[i][j]=inf; } } dp[0][0]=0; } int main(){ cin>>n>>x>>y; for(int i=1;i<=n;i++) cin>>a[i]; memo(); for(int i=1;i<=n;i++){ int sum=0; for(int j=i;j>=1;j--){ sum+=a[j]; for(int k=0;k<=2050;k++){ if(dp[j-1][k]==inf) continue; dp[i][sum|k]=min(dp[i][sum|k],dp[j-1][k]+1); } } } int ans=inf; for(int i=1;i<=2050;i++){ if(dp[n][i]!=inf && dp[n][i]<=y){ cout<<i<<endl; exit(0); } } }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 384 KB | Output is correct |
2 | Correct | 2 ms | 384 KB | Output is correct |
3 | Incorrect | 2 ms | 384 KB | Output isn't correct |
4 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 3 ms | 384 KB | Output is correct |
2 | Correct | 3 ms | 384 KB | Output is correct |
3 | Incorrect | 2 ms | 384 KB | Output isn't correct |
4 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 428 KB | Output is correct |
2 | Correct | 3 ms | 384 KB | Output is correct |
3 | Incorrect | 2 ms | 256 KB | Output isn't correct |
4 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 384 KB | Output is correct |
2 | Correct | 2 ms | 384 KB | Output is correct |
3 | Incorrect | 2 ms | 256 KB | Output isn't correct |
4 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 3 ms | 384 KB | Output is correct |
2 | Correct | 3 ms | 384 KB | Output is correct |
3 | Incorrect | 2 ms | 256 KB | Output isn't correct |
4 | Halted | 0 ms | 0 KB | - |