# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
707793 | TAhmed33 | Mate (COCI18_mate) | C++98 | 51 ms | 65968 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;
#define int long long
vector <int> arr;
int n;
int dp[26][26][2001] = {};
const int MOD = 1e9 + 7;
int ncr[2001][2001];
signed main () {
ios::sync_with_stdio(false);
cin.tie(0);
string s;
cin >> s;
n = s.length();
for (int i = 0; i <= n; i++) {
for (int j = 0; j <= n; j++) {
if (j == 0 || j == i) {
ncr[i][j] = 1;
} else if (i < j) {
ncr[i][j] = 0;
} else {
ncr[i][j] = ncr[i - 1][j] + ncr[i - 1][j - 1];
if (ncr[i][j] >= MOD) ncr[i][j] -= MOD;
}
}
}
arr.push_back(8);
for (int i = 0; i < n; i++) {
arr.push_back(s[i] - 'a');
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |