Submission #143697


Source Code Expand

Copy
#include <iostream>
#include <cstdio>
#include <map>
#include <set>
using namespace std;
const int MAX_N = 105;

int main(int argc, const char * argv[])
{
    string s;
    cin >> s;
    int diff = 0;
    int n = (int)s.size();
    for (int i = 0; i < n/2; i++) {
        if (s[i] != s[n-1-i]) {
            diff++;
        }
    }
    int ret = 0;
    if (n != 1) {
        if (diff == 1) {
            ret = 25 * ((int)s.size()-2) + 24*2;
        } else {
            ret = 25 * (int)s.size();
            if (diff == 0 && n&1) {
                ret -= 25;
            }
        }
    }
    printf("%d\n", ret);
    return 0;
}

Submission Info

Submission Time
Task B - こだわりの名前
User koyahi
Language C++ (G++ 4.6.4)
Score 100
Code Size 662 Byte
Status
Exec Time 38 ms
Memory 1404 KB

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 36 ms 1328 KB
hand_2.txt 38 ms 1328 KB
hand_3.txt 35 ms 1312 KB
hand_4.txt 35 ms 1316 KB
hand_5.txt 38 ms 1328 KB
hand_6.txt 36 ms 1324 KB
palindrome_1.txt 21 ms 676 KB
palindrome_12345.txt 21 ms 928 KB
palindrome_2.txt 20 ms 796 KB
palindrome_299998.txt 37 ms 1404 KB
palindrome_299999.txt 35 ms 1312 KB
palindrome_3.txt 21 ms 800 KB
palindrome_300000.txt 36 ms 1316 KB
palindrome_4.txt 20 ms 920 KB
palindrome_5.txt 21 ms 804 KB
palindrome_6789.txt 20 ms 800 KB
palindrome_67890.txt 25 ms 976 KB
palindrome_mod_1.txt 21 ms 928 KB
palindrome_mod_1000.txt 21 ms 928 KB
palindrome_mod_10000.txt 20 ms 796 KB
palindrome_mod_100001.txt 25 ms 1012 KB
palindrome_mod_2.txt 20 ms 676 KB
palindrome_mod_200000.txt 30 ms 1184 KB
palindrome_mod_299999.txt 36 ms 1324 KB
palindrome_mod_3.txt 23 ms 764 KB
palindrome_mod_300000.txt 36 ms 1328 KB
palindrome_mod_4.txt 21 ms 928 KB
palindrome_mod_5.txt 21 ms 804 KB
palindrome_mod_50001.txt 24 ms 928 KB
random_1.txt 21 ms 804 KB
random_10.txt 20 ms 928 KB
random_100001.txt 26 ms 936 KB
random_101.txt 20 ms 804 KB
random_3000.txt 21 ms 932 KB
random_300000.txt 36 ms 1332 KB
random_50001.txt 23 ms 928 KB
sample_1.txt 20 ms 924 KB
sample_2.txt 21 ms 928 KB
sample_3.txt 20 ms 924 KB