답안 #549069

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
549069 2022-04-15T05:03:18 Z Blobo2_Blobo2 Bali Sculptures (APIO15_sculpture) C++17
0 / 100
1000 ms 31752 KB
/*
Editor: Abdelrahman Hossam
Nickname: Blobo2_Blobo2
IOI next year isA :)
*/
/*#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math,O3")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,sse4.2,popcnt,abm,mmx,avx2")
#pragma GCC optimize("-ffast-math")
#pragma GCC optimize("-funroll-loops")
#pragma GCC optimize("-funroll-all-loops,-fpeel-loops,-funswitch-loop")*/

#include<bits/stdc++.h>
using namespace std;
#define int long long
#define endl "\n"
#define all(v)  v.begin(),v.end()
#define gen(arr,n,nxt)  generate(arr,arr+n,nxt)
#define Blobo2 ios_base::sync_with_stdio(false);cin.tie(0);

const int mo=1e9+7;
int nxt(){int x;cin>>x;return x;}
int arr[2001],n,l,r;
int dp[2001][2001];
int solve(int idx=0,int part=1,int sum=0){
    //cout<<idx<<' '<<part<<' '<<sum<<endl;
    if(part>r)
        return 1e18;
    if(idx==n){
        if(part<l)return 1e18;
        return sum;
    }
    int ret = 0;
    //if(ret!=-1)return ret;
    return ret = min(solve(idx+1,part+1,0)|(sum+arr[idx]),
                     solve(idx+1,part,sum+arr[idx]));
}

signed main(){
    Blobo2
	 n=nxt(),l=nxt(),r=nxt();
    gen(arr,n,nxt);
    memset(dp,-1,sizeof dp);
    cout<<solve();
    return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 14 ms 31664 KB Output is correct
2 Correct 13 ms 31572 KB Output is correct
3 Correct 13 ms 31572 KB Output is correct
4 Correct 14 ms 31572 KB Output is correct
5 Correct 13 ms 31572 KB Output is correct
6 Correct 13 ms 31640 KB Output is correct
7 Correct 13 ms 31572 KB Output is correct
8 Correct 13 ms 31556 KB Output is correct
9 Correct 15 ms 31572 KB Output is correct
10 Correct 14 ms 31700 KB Output is correct
11 Correct 13 ms 31620 KB Output is correct
12 Correct 15 ms 31620 KB Output is correct
13 Correct 20 ms 31572 KB Output is correct
14 Correct 13 ms 31560 KB Output is correct
15 Incorrect 13 ms 31612 KB Output isn't correct
16 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 13 ms 31572 KB Output is correct
2 Correct 13 ms 31576 KB Output is correct
3 Correct 14 ms 31572 KB Output is correct
4 Correct 14 ms 31572 KB Output is correct
5 Correct 14 ms 31640 KB Output is correct
6 Correct 13 ms 31648 KB Output is correct
7 Correct 15 ms 31572 KB Output is correct
8 Correct 13 ms 31572 KB Output is correct
9 Correct 14 ms 31572 KB Output is correct
10 Correct 13 ms 31560 KB Output is correct
11 Correct 14 ms 31616 KB Output is correct
12 Correct 13 ms 31664 KB Output is correct
13 Correct 19 ms 31572 KB Output is correct
14 Correct 14 ms 31636 KB Output is correct
15 Incorrect 14 ms 31664 KB Output isn't correct
16 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 14 ms 31572 KB Output is correct
2 Correct 13 ms 31604 KB Output is correct
3 Correct 16 ms 31656 KB Output is correct
4 Correct 17 ms 31552 KB Output is correct
5 Correct 14 ms 31572 KB Output is correct
6 Correct 14 ms 31572 KB Output is correct
7 Correct 13 ms 31620 KB Output is correct
8 Correct 14 ms 31572 KB Output is correct
9 Correct 15 ms 31628 KB Output is correct
10 Correct 14 ms 31568 KB Output is correct
11 Correct 13 ms 31572 KB Output is correct
12 Correct 13 ms 31572 KB Output is correct
13 Correct 19 ms 31636 KB Output is correct
14 Correct 25 ms 31556 KB Output is correct
15 Correct 51 ms 31648 KB Output is correct
16 Correct 16 ms 31572 KB Output is correct
17 Execution timed out 1083 ms 31572 KB Time limit exceeded
18 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 14 ms 31572 KB Output is correct
2 Correct 13 ms 31620 KB Output is correct
3 Correct 13 ms 31564 KB Output is correct
4 Correct 13 ms 31572 KB Output is correct
5 Correct 13 ms 31652 KB Output is correct
6 Correct 14 ms 31564 KB Output is correct
7 Correct 14 ms 31612 KB Output is correct
8 Correct 14 ms 31572 KB Output is correct
9 Correct 14 ms 31600 KB Output is correct
10 Correct 13 ms 31560 KB Output is correct
11 Correct 12 ms 31560 KB Output is correct
12 Correct 13 ms 31560 KB Output is correct
13 Correct 21 ms 31752 KB Output is correct
14 Correct 15 ms 31572 KB Output is correct
15 Incorrect 13 ms 31580 KB Output isn't correct
16 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 16 ms 31664 KB Output is correct
2 Correct 13 ms 31572 KB Output is correct
3 Correct 14 ms 31652 KB Output is correct
4 Correct 14 ms 31672 KB Output is correct
5 Correct 13 ms 31580 KB Output is correct
6 Correct 14 ms 31568 KB Output is correct
7 Correct 14 ms 31564 KB Output is correct
8 Correct 15 ms 31620 KB Output is correct
9 Correct 14 ms 31624 KB Output is correct
10 Correct 14 ms 31572 KB Output is correct
11 Correct 14 ms 31572 KB Output is correct
12 Correct 13 ms 31556 KB Output is correct
13 Correct 18 ms 31572 KB Output is correct
14 Correct 14 ms 31656 KB Output is correct
15 Correct 13 ms 31564 KB Output is correct
16 Correct 14 ms 31572 KB Output is correct
17 Correct 13 ms 31624 KB Output is correct
18 Incorrect 16 ms 31572 KB Output isn't correct
19 Halted 0 ms 0 KB -