# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
751019 | Sami_Massah | Skyscraper (JOI16_skyscraper) | C++17 | 127 ms | 5816 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;
const long long maxn = 100 + 12, maxk = 3000, inf = 1001, mod = 1e9 + 7;
long long n, mx, a[maxn], dp[2][maxn][maxk][3];
int main(){
cin >> n >> mx;
for(int i = 0; i < n; i++){
cin >> a[i];
// a[i] = i * 2 + 1;
}
if(n == 1){
cout << 1 << endl;
return 0;
}
sort(a, a + n);
for(int i = n; i >= 1; i--)
swap(a[i], a[i - 1]);
a[n + 1] = inf;
//cout << a[1] << ' ' << a[2] << endl;
dp[0][0][0][0] = 1;
for(int i = 1; i <= n; i++)
for(int j = 1; j <= n; j++)
for(int c = 0; c <= mx; c++)
for(int m = 0; m <= 2; m++){
int delta = (2 * j - m) * (a[i + 1] - a[i]);
dp[i & 1][j][c][m] = 0;
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |