# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
707795 | TAhmed33 | Mate (COCI18_mate) | C++98 | 2100 ms | 17104 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
vector <int> arr;
int n;
int dp[2001][26][26] = {};
const int MOD = 1e9 + 7;
int ncr[2001][2001];
int 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 (auto i : s) arr.push_back(i - 'a');
for (int i = 1; i <= n - 1; i++) {
for (int j = i + 1; j <= n; j++) {
for (int k = 2; k <= i + 1; k++) {
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |