# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
403402 | CursedCode | Boat (APIO16_boat) | C++14 | 0 ms | 0 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 "boat.h"
#include<bits/stdc++.h>
using namespace std;
long long a[1000];
long long dp[1000] = {0};
long long boat(int n){
dp[1] = 1;
a[n + 1] = 1000000000;
for(int i = 1;i <= n + 1;i++){
for(int j = i - 1;j >= 1;j--){
if(a[j] < a[i]) dp[i] += dp[j];
}
dp[i] += 1;
}
return dp[n + 1] - 1;
}