답안 #882432

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
882432 2023-12-03T07:28:18 Z vjudge1 Bali Sculptures (APIO15_sculpture) C++17
21 / 100
52 ms 79840 KB
#pragma optimize("Bismillahirrahmanirrahim")
//█▀█─█──█──█▀█─█─█
//█▄█─█──█──█▄█─█■█
//█─█─█▄─█▄─█─█─█─█
//Allahuekber
//ahmet23 orz...
//Sani buyuk Osman Pasa Plevneden cikmam diyor.
//FatihSultanMehmedHan
//YavuzSultanSelimHan
//AbdulhamidHan
#define author tolbi
#include <bits/stdc++.h>
using namespace std;
template<typename X, typename Y> istream& operator>>(istream& in, pair<X,Y> &pr) {return in>>pr.first>>pr.second;}
template<typename X, typename Y> ostream& operator<<(ostream& os, pair<X,Y> pr) {return os<<pr.first<<" "<<pr.second;}
template<typename X> istream& operator>>(istream& in, vector<X> &arr) {for(auto &it : arr) in>>it; return in;}
template<typename X> ostream& operator<<(ostream& os, vector<X> arr) {for(auto &it : arr) os<<it<<" "; return os;}
template<typename X, size_t Y> istream& operator>>(istream& in, array<X,Y> &arr) {for(auto &it : arr) in>>it; return in;}
template<typename X, size_t Y> ostream& operator<<(ostream& os, array<X,Y> arr) {for(auto &it : arr) os<<it<<" "; return os;}
#define int long long
#define endl '\n'
#define vint(x) vector<int> x
#define deci(x) int x;cin>>x;
#define decstr(x) string x;cin>>x;
#define cinarr(x) for (auto &it : x) cin>>it;
#define coutarr(x) for (auto &it : x) cout<<it<<" ";cout<<endl;
#define sortarr(x) sort(x.begin(),x.end())
#define sortrarr(x) sort(x.rbegin(),x.rend())
#define det(x) cout<<"NO\0YES"+x*3<<endl;
#define INF LONG_LONG_MAX
#define rev(x) reverse(x.begin(),x.end());
#define ios ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define tol(bi) (1LL<<((int)(bi)))
const int MOD = 1e9+7;
mt19937 ayahya(chrono::high_resolution_clock().now().time_since_epoch().count());
int32_t main(){
	ios;
	int t=1;
	int tno = 0;
	if (!t) cin>>t;
	while (t-(tno++)){
		deci(n);deci(a);deci(b);
		vint(arr(n));
		cinarr(arr);
		vector<vector<vector<int>>> dp(n,vector<vector<int>>(n,vector<int>(1000,-1)));
		vector<int> pref = arr;
		for (int i = 1; i < n; i++){
			pref[i]+=pref[i-1];
		}
		function<int(int,int)> query = [&](int l, int r)->int{
			int hh = 0;
			if (l) hh = pref[l-1];
			return pref[r]-hh;
		};
		function<int(int,int,int)> f = [&](int l, int r, int x)->int{
			if (r>=n){
				if (l==r && x>=a && x<=b) return 0;
				else return -1;
			}
			if (dp[l][r][x]!=-1) return dp[l][r][x];
			if (f(r+1,r+1,x+1)!=-1) dp[l][r][x]=f(r+1,r+1,x+1)|query(l,r);
			else dp[l][r][x]=INF;
			if (f(l,r+1,x)!=-1) dp[l][r][x]=min(dp[l][r][x],f(l,r+1,x));
			return dp[l][r][x];
		};
		cout<<f(0,0,0)<<endl;
	}
}

Compilation message

sculpture.cpp:1: warning: ignoring '#pragma optimize ' [-Wunknown-pragmas]
    1 | #pragma optimize("Bismillahirrahmanirrahim")
      |
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 600 KB Output is correct
2 Correct 1 ms 860 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 600 KB Output is correct
5 Correct 1 ms 1112 KB Output is correct
6 Correct 1 ms 2140 KB Output is correct
7 Correct 1 ms 2652 KB Output is correct
8 Correct 2 ms 3676 KB Output is correct
9 Correct 2 ms 3676 KB Output is correct
10 Correct 2 ms 3676 KB Output is correct
11 Correct 2 ms 3676 KB Output is correct
12 Correct 2 ms 3720 KB Output is correct
13 Correct 2 ms 3676 KB Output is correct
14 Correct 0 ms 604 KB Output is correct
15 Correct 1 ms 600 KB Output is correct
16 Correct 1 ms 604 KB Output is correct
17 Correct 0 ms 604 KB Output is correct
18 Correct 1 ms 1116 KB Output is correct
19 Correct 1 ms 2140 KB Output is correct
20 Correct 1 ms 2652 KB Output is correct
21 Incorrect 2 ms 3676 KB Output isn't correct
22 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 604 KB Output is correct
2 Correct 0 ms 860 KB Output is correct
3 Correct 0 ms 400 KB Output is correct
4 Correct 0 ms 604 KB Output is correct
5 Correct 1 ms 1116 KB Output is correct
6 Correct 1 ms 2140 KB Output is correct
7 Correct 1 ms 2652 KB Output is correct
8 Correct 1 ms 3676 KB Output is correct
9 Correct 1 ms 3676 KB Output is correct
10 Correct 2 ms 3676 KB Output is correct
11 Correct 1 ms 3676 KB Output is correct
12 Correct 2 ms 3676 KB Output is correct
13 Correct 2 ms 3676 KB Output is correct
14 Correct 0 ms 604 KB Output is correct
15 Correct 1 ms 604 KB Output is correct
16 Correct 0 ms 604 KB Output is correct
17 Correct 0 ms 604 KB Output is correct
18 Correct 1 ms 1116 KB Output is correct
19 Correct 1 ms 2140 KB Output is correct
20 Correct 1 ms 2652 KB Output is correct
21 Incorrect 2 ms 3676 KB Output isn't correct
22 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 604 KB Output is correct
2 Correct 1 ms 860 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 856 KB Output is correct
5 Correct 1 ms 1116 KB Output is correct
6 Correct 1 ms 2140 KB Output is correct
7 Correct 1 ms 2652 KB Output is correct
8 Correct 1 ms 3676 KB Output is correct
9 Correct 2 ms 3676 KB Output is correct
10 Correct 2 ms 3676 KB Output is correct
11 Correct 2 ms 3676 KB Output is correct
12 Correct 2 ms 3676 KB Output is correct
13 Correct 1 ms 3676 KB Output is correct
14 Correct 2 ms 4188 KB Output is correct
15 Correct 2 ms 5468 KB Output is correct
16 Correct 5 ms 12128 KB Output is correct
17 Correct 7 ms 14576 KB Output is correct
18 Correct 9 ms 20316 KB Output is correct
19 Correct 9 ms 20516 KB Output is correct
20 Correct 9 ms 20312 KB Output is correct
21 Correct 11 ms 20316 KB Output is correct
22 Correct 11 ms 20512 KB Output is correct
23 Correct 9 ms 20312 KB Output is correct
24 Correct 10 ms 21084 KB Output is correct
25 Correct 16 ms 34228 KB Output is correct
26 Correct 28 ms 49008 KB Output is correct
27 Correct 34 ms 66140 KB Output is correct
28 Correct 42 ms 79700 KB Output is correct
29 Correct 52 ms 79840 KB Output is correct
30 Correct 50 ms 79700 KB Output is correct
31 Correct 42 ms 79708 KB Output is correct
32 Correct 42 ms 79708 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 604 KB Output is correct
2 Correct 1 ms 860 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 604 KB Output is correct
5 Correct 1 ms 1116 KB Output is correct
6 Correct 1 ms 2140 KB Output is correct
7 Correct 1 ms 2652 KB Output is correct
8 Correct 2 ms 3676 KB Output is correct
9 Correct 2 ms 3676 KB Output is correct
10 Correct 2 ms 3676 KB Output is correct
11 Correct 2 ms 3676 KB Output is correct
12 Correct 1 ms 3676 KB Output is correct
13 Correct 2 ms 3764 KB Output is correct
14 Correct 0 ms 604 KB Output is correct
15 Correct 0 ms 604 KB Output is correct
16 Correct 0 ms 604 KB Output is correct
17 Correct 1 ms 604 KB Output is correct
18 Correct 1 ms 1116 KB Output is correct
19 Correct 1 ms 2140 KB Output is correct
20 Correct 1 ms 2652 KB Output is correct
21 Incorrect 2 ms 3676 KB Output isn't correct
22 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 604 KB Output is correct
2 Correct 0 ms 860 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 604 KB Output is correct
5 Correct 1 ms 1116 KB Output is correct
6 Correct 1 ms 2140 KB Output is correct
7 Correct 1 ms 2652 KB Output is correct
8 Correct 2 ms 3672 KB Output is correct
9 Correct 2 ms 3676 KB Output is correct
10 Correct 1 ms 3676 KB Output is correct
11 Correct 1 ms 3676 KB Output is correct
12 Correct 2 ms 3676 KB Output is correct
13 Correct 2 ms 3676 KB Output is correct
14 Correct 0 ms 604 KB Output is correct
15 Correct 1 ms 1116 KB Output is correct
16 Correct 1 ms 1884 KB Output is correct
17 Correct 2 ms 3420 KB Output is correct
18 Incorrect 2 ms 3676 KB Output isn't correct
19 Halted 0 ms 0 KB -