Submission #22779

#TimeUsernameProblemLanguageResultExecution timeMemory
22779↓우리보다잘하는팀 (#40)New Ocurrences (KRIII5_NO)C++14
0 / 7
1000 ms119752 KiB
#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)

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...