Submission #143665


Source Code Expand

Copy
import java.util.Scanner;

public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		String s = sc.next();

		int differentCount = 0;
		int size = s.length();
		int res = 1;
		int mid = size>>1;
		for(int i=0;i<mid;i++){
			if(s.charAt(i) != s.charAt(size-i-1)){
				differentCount++;
				if(differentCount>=2)
					break;
			}
		}
		
		if(differentCount>=2){
			res = size * 25;
		}else if(differentCount == 1){
			res = 24*2 + 25*(size-2); 
		}else{
			res = 25*(size>>1)*2;
		}
		System.out.println(res);
		
	}
}

Submission Info

Submission Time
Task B - こだわりの名前
User scache
Language Java (OpenJDK 1.7.0)
Score 100
Code Size 588 Byte
Status AC
Exec Time 570 ms
Memory 28940 KB

Judge Result

Set Name All
Score / Max Score 100 / 100
Status
AC × 36
Set Name Test Cases
All 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 AC 550 ms 28020 KB
hand_2.txt AC 522 ms 28264 KB
hand_3.txt AC 520 ms 28380 KB
hand_4.txt AC 544 ms 28408 KB
hand_5.txt AC 531 ms 28392 KB
hand_6.txt AC 516 ms 28696 KB
palindrome_1.txt AC 431 ms 22968 KB
palindrome_12345.txt AC 487 ms 24684 KB
palindrome_2.txt AC 429 ms 23216 KB
palindrome_299998.txt AC 534 ms 28536 KB
palindrome_299999.txt AC 519 ms 28740 KB
palindrome_3.txt AC 430 ms 23216 KB
palindrome_300000.txt AC 531 ms 28280 KB
palindrome_4.txt AC 429 ms 23092 KB
palindrome_5.txt AC 431 ms 23096 KB
palindrome_6789.txt AC 469 ms 24360 KB
palindrome_67890.txt AC 519 ms 25776 KB
palindrome_mod_1.txt AC 439 ms 23080 KB
palindrome_mod_1000.txt AC 441 ms 23188 KB
palindrome_mod_10000.txt AC 524 ms 25452 KB
palindrome_mod_100001.txt AC 518 ms 25540 KB
palindrome_mod_2.txt AC 446 ms 23088 KB
palindrome_mod_200000.txt AC 526 ms 26812 KB
palindrome_mod_299999.txt AC 531 ms 28400 KB
palindrome_mod_3.txt AC 430 ms 23096 KB
palindrome_mod_300000.txt AC 570 ms 28940 KB
palindrome_mod_4.txt AC 428 ms 23088 KB
palindrome_mod_5.txt AC 431 ms 22964 KB
palindrome_mod_50001.txt AC 521 ms 25128 KB
random_1.txt AC 430 ms 23148 KB
random_10.txt AC 430 ms 23092 KB
random_100001.txt AC 503 ms 25832 KB
random_101.txt AC 432 ms 23088 KB
random_3000.txt AC 453 ms 23092 KB
random_300000.txt AC 527 ms 28608 KB
random_50001.txt AC 502 ms 25200 KB
sample_1.txt AC 429 ms 23092 KB
sample_2.txt AC 432 ms 23084 KB
sample_3.txt AC 428 ms 23004 KB