Submission #143729


Source Code Expand

Copy
#include <stdio.h>
#include <string.h>

char a[300001];
int equal[150000];

int main(void) {
	int i;
	int len, sumEqual;

	scanf("%s", a);
	len = strlen(a);

	for (i = 0; i < (len + 1) / 2; i++)
		equal[i] = a[i] == a[len - i - 1];

	sumEqual = 0;
	for (i = 0; i < (len + 1) / 2; i++)
		sumEqual += equal[i];

	if (sumEqual == (len + 1) / 2 - 1)
		printf("%d\n", 25 * len - 2);
	else if (sumEqual == (len + 1) / 2)
		printf("%d\n", len & 1 ? 25 * len - 25 : 25 * len);
	else
		printf("%d\n", 25 * len);

	return 0;
}

Submission Info

Submission Time
Task B - こだわりの名前
User zeosutt
Language C (GCC 4.6.4)
Score 100
Code Size 546 Byte
Status
Exec Time 24 ms
Memory 1688 KB

Compile Error

./Main.c: In function ‘main’:
./Main.c:11:7: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]

Test Cases

Set Name Score / Max Score Test Cases
All 100 / 100 hand_1.txt, hand_2.txt, hand_3.txt, hand_4.txt, hand_5.txt, hand_6.txt, palindrome_1.txt, palindrome_12345.txt, palindrome_2.txt, palindrome_299998.txt, palindrome_299999.txt, palindrome_3.txt, palindrome_300000.txt, palindrome_4.txt, palindrome_5.txt, palindrome_6789.txt, palindrome_67890.txt, palindrome_mod_1.txt, palindrome_mod_1000.txt, palindrome_mod_10000.txt, palindrome_mod_100001.txt, palindrome_mod_2.txt, palindrome_mod_200000.txt, palindrome_mod_299999.txt, palindrome_mod_3.txt, palindrome_mod_300000.txt, palindrome_mod_4.txt, palindrome_mod_5.txt, palindrome_mod_50001.txt, random_1.txt, random_10.txt, random_100001.txt, random_101.txt, random_3000.txt, random_300000.txt, random_50001.txt
Case Name Status Exec Time Memory
hand_1.txt 23 ms 1572 KB
hand_2.txt 23 ms 1576 KB
hand_3.txt 23 ms 1580 KB
hand_4.txt 22 ms 1684 KB
hand_5.txt 23 ms 1572 KB
hand_6.txt 23 ms 1688 KB
palindrome_1.txt 22 ms 684 KB
palindrome_12345.txt 21 ms 692 KB
palindrome_2.txt 22 ms 792 KB
palindrome_299998.txt 24 ms 1688 KB
palindrome_299999.txt 22 ms 1680 KB
palindrome_3.txt 19 ms 792 KB
palindrome_300000.txt 22 ms 1684 KB
palindrome_4.txt 21 ms 788 KB
palindrome_5.txt 22 ms 784 KB
palindrome_6789.txt 21 ms 796 KB
palindrome_67890.txt 20 ms 844 KB
palindrome_mod_1.txt 20 ms 796 KB
palindrome_mod_1000.txt 19 ms 792 KB
palindrome_mod_10000.txt 21 ms 796 KB
palindrome_mod_100001.txt 21 ms 1048 KB
palindrome_mod_2.txt 21 ms 788 KB
palindrome_mod_200000.txt 22 ms 1192 KB
palindrome_mod_299999.txt 24 ms 1680 KB
palindrome_mod_3.txt 22 ms 688 KB
palindrome_mod_300000.txt 22 ms 1564 KB
palindrome_mod_4.txt 18 ms 788 KB
palindrome_mod_5.txt 23 ms 728 KB
palindrome_mod_50001.txt 19 ms 916 KB
random_1.txt 23 ms 700 KB
random_10.txt 20 ms 792 KB
random_100001.txt 20 ms 1048 KB
random_101.txt 20 ms 788 KB
random_3000.txt 20 ms 796 KB
random_300000.txt 22 ms 1608 KB
random_50001.txt 21 ms 920 KB
sample_1.txt 23 ms 796 KB
sample_2.txt 21 ms 796 KB
sample_3.txt 21 ms 792 KB