# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
982623 | dimashhh | Skyscraper (JOI16_skyscraper) | C++17 | 168 ms | 87232 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>
using namespace std;
typedef long long ll;
const int N = 1e2 + 5, MOD = 1e9 + 7;
int n,l,a[N];
int dp[N][N][2][2][N*10];
void add(int &x,int y){
x += y;
if(x >= MOD) x -= MOD;
}
void test(){
cin >> n >> l;
for(int i = 1;i <= n;i++) {
cin >> a[i];
}
sort(a + 1,a + n + 1);
if(n == 1) {
cout << 1;
return;
}
if(a[2] - a[1] + a[2] - a[1] <= l) dp[2][1][0][0][(a[2]-a[1])*2] = 1;
if(a[2] - a[1] <= l) dp[2][1][0][1][a[2]-a[1]] = dp[2][1][1][0][a[2]-a[1]] = 1;
a[n+1] = 10000;
for(int i = 2;i <= n;i++){
for(int j = 1;j <= i;j++){
for(int s = 0;s < 2;s++){
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |