답안 #212695

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
212695 2020-03-24T06:35:20 Z iris2617 Bali Sculptures (APIO15_sculpture) C++14
0 / 100
112 ms 190200 KB
#include <bits/stdc++.h>
#define int long long
#define iris 998244353
using namespace std;

set<int> dp[2010][2010];
int arr[2010];

signed main(){
	ios::sync_with_stdio(0);
	cin.tie(0);
	
	int n,ans,i,j,k,a,b;
	cin>>n>>a>>b;
	
	for(i=1;i<=n;i++)
	{
		cin>>arr[i];
		arr[i]+=arr[i-1];
	}
	
	dp[0][0].insert(0);
	for(i=1;i<=b;i++)
	{
		for(j=1;j<=n;j++)
		{
			for(k=0;k<j;k++)
			{
				for(int ouo:dp[i-1][k])
				{
					dp[i][j].insert(ouo|(arr[j]-arr[k]));
				}
			}
		}
	}
	cout<<*dp[b][n].lower_bound(-1)<<'\n';
	
	return 0;
}

Compilation message

sculpture.cpp: In function 'int main()':
sculpture.cpp:13:8: warning: unused variable 'ans' [-Wunused-variable]
  int n,ans,i,j,k,a,b;
        ^~~
# 결과 실행 시간 메모리 Grader output
1 Correct 104 ms 190076 KB Output is correct
2 Correct 105 ms 190072 KB Output is correct
3 Correct 106 ms 190072 KB Output is correct
4 Correct 104 ms 190072 KB Output is correct
5 Correct 104 ms 190072 KB Output is correct
6 Incorrect 106 ms 190200 KB Output isn't correct
7 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 106 ms 190072 KB Output is correct
2 Correct 105 ms 190072 KB Output is correct
3 Correct 104 ms 190072 KB Output is correct
4 Correct 105 ms 190072 KB Output is correct
5 Correct 110 ms 190072 KB Output is correct
6 Incorrect 105 ms 190072 KB Output isn't correct
7 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 102 ms 190072 KB Output is correct
2 Correct 105 ms 190056 KB Output is correct
3 Correct 110 ms 190136 KB Output is correct
4 Correct 106 ms 190072 KB Output is correct
5 Correct 105 ms 190072 KB Output is correct
6 Incorrect 104 ms 190072 KB Output isn't correct
7 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 105 ms 190072 KB Output is correct
2 Correct 104 ms 190072 KB Output is correct
3 Correct 104 ms 190072 KB Output is correct
4 Correct 103 ms 190072 KB Output is correct
5 Correct 105 ms 190164 KB Output is correct
6 Incorrect 112 ms 190200 KB Output isn't correct
7 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 102 ms 190072 KB Output is correct
2 Correct 104 ms 190072 KB Output is correct
3 Correct 102 ms 190072 KB Output is correct
4 Correct 103 ms 190072 KB Output is correct
5 Correct 103 ms 190072 KB Output is correct
6 Incorrect 105 ms 190072 KB Output isn't correct
7 Halted 0 ms 0 KB -