# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1079413 | alexander707070 | Skyscraper (JOI16_skyscraper) | C++14 | 2054 ms | 122448 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<bits/stdc++.h>
#define MAXN 107
#define MAXS 6007
using namespace std;
const long long mod=1e9+7;
int n,s,a[MAXN],ans,pref[2*MAXN];
int dp[MAXN][MAXN/2+7][3][3][MAXS];
bool li[MAXN][MAXN/2+7][3][3][MAXS];
bool ok(int sum){
return true;
// return sum>=-5000 and sum<=s;
}
long long even(int pos,int bal,int sum,int l,int r){
if(sum>s or bal>n/2+5)return 0;
if(sum+pref[pos+(bal-5)-2]-pref[pos-1]>s)return 0;
long long free=2*(bal-5)+(-(l==1)-(r==1)) - (-(l==2)-(r==2));
if(free<0)return 0;
if(pos==n+1 and bal==5 and l+r==3 and free==0)return 1;
else if(pos==n+1 and (bal==4 or bal==6) and l==r and l!=0 and free==0)return 1;
else if(pos==n+1)return 0;
if(free==0 and pos!=1)return 0;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |