# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
83352 | charlies_moo | Mate (COCI18_mate) | C++17 | 453 ms | 36816 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 <cstdio>
#include <cstring>
const int z = 1e9+7;
int main() {
char s[2001];
scanf("%s", s);
int n = strlen(s);
int pt[n][n];
pt[0][0] = 1;
for (int i = 1; i < n; i++) {
pt[i][0] = pt[i][i] = 1;
for (int j = 1; j < i; j++) {
pt[i][j] = (pt[i-1][j-1] + pt[i-1][j]) % z;
}
}
int c[n][26];
for (int i = 0; i < 26; i++) {
c[n-1][i] = 0;
}
for (int i = n - 2; i >= 0; i--) {
for (int j = 0; j < 26; j++) {
c[i][j] = c[i+1][j];
}
c[i][s[i+1]-'a']++;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |