제출 #22787

#제출 시각아이디문제언어결과실행 시간메모리
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);
	}
}

컴파일 시 표준 에러 (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...