# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
22779 | ↓우리보다잘하는팀 (#40) | New Ocurrences (KRIII5_NO) | C++14 | 1000 ms | 119752 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 long long, int> d;
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 = 27 * k + a[j];
r += d[k] << 1 | 1;
d[k]++;
}
printf("%lld\n", r);
}
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |