# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
22806 | ↓우리보다잘하는팀 (#40) | New Ocurrences (KRIII5_NO) | C++14 | 1000 ms | 145952 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>
#include <unordered_map>
using namespace std;
char a[5005];
unordered_map<unsigned int, int> d[5005];
int main() {
long long r = 0;
int i, j, k, n;
scanf("%s", a);
n = strlen(a);
for (i = 0; i < n; i++) {
k = 0;
for (j = i; j >= 0; j--) {
k = 365079813 * k + a[j];
r += d[i - j][k] << 1 | 1;
d[i - j][k]++;
}
printf("%lld\n", r);
}
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |