Submission #22787

#TimeUsernameProblemLanguageResultExecution timeMemory
22787↓우리보다잘하는팀 (#40)New Ocurrences (KRIII5_NO)C++14
0 / 7
1000 ms157496 KiB
#include <cstdio> #include <cstring> #include <unordered_map> using namespace std; char a[5005]; unordered_map<unsigned long long, 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 = 91468532985719 * k + a[j]; r += d[i - j][k] << 1 | 1; d[i - j][k]++; } printf("%lld\n", r); } }

Compilation message (stderr)

NO.cpp: In function 'int main()':
NO.cpp:13:16: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%s", a);
                ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...