# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
109550 | PeppaPig | Boat (APIO16_boat) | C++14 | 871 ms | 4508 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 long long long
using namespace std;
const int N = 1005;
const int M = 1e9+7;
long fac[N], inv[N];
long modpow(long a, long b) {
long ret = 1;
for( ; b; b >>= 1) {
if(b & 1) ret = (ret * a) % M;
a = (a * a) % M;
}
return ret;
}
void pre_process() {
fac[0] = inv[0] = 1;
for(int i = 1; i < N; i++) fac[i] = (fac[i-1] * i) % M;
for(int i = 1; i < N; i++) inv[i] = modpow(fac[i], M-2);
}
long ncr(int n, int r) { return fac[n] * (inv[r] * inv[n-r] % M) % M; }
int n, a[N], b[N];
long dp[N][N];
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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |