Submission #144384


Source Code Expand

Copy
#include <iostream>
#include <vector>
#include <stack>
#include <queue>
#include <algorithm>
#include <string>
#include <bitset>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <sstream>
#include <fstream>
#include <tuple>
#include <set>
#include <string.h>

#define X first
#define Y second
#define MP make_pair
#define MT make_tuple
#define FOR(i, n) for(int (i) = 0; (i) < (n); (i)++)
typedef long long ll;
using namespace std;
const int MAX = 101;

template<class T, class U>
void convert(T &t, U &u){
	stringstream ss;
	ss << t;
	ss >> u;
}

bool b[30001];

int main(){
	string n;
	cin >> n;

	if (n.size() == 1){
		cout << 0 << endl;
		return 0;
	}

	int ans = 0;
	int h = n.size() / 2;
	int idx = 1;
	vector<int> t;
	bool f = true;

	FOR(i, h){
		if (n[i] != n[n.size() - 1 - i]){
			ans += 48;
			f = false;
		}
		else{
			ans += 50;
		}
	}

	if (!f && n.size()%2) ans += 25;

	cout << ans << endl;
	return 0;
}

Submission Info

Submission Time
Task B - こだわりの名前
User keny30827
Language C++11 (GCC 4.8.1)
Score 0
Code Size 1013 Byte
Status
Exec Time 65 ms
Memory 1716 KB

Test Cases

Set Name Score / Max Score Test Cases
All 0 / 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 65 ms 1604 KB
hand_2.txt 41 ms 1612 KB
hand_3.txt 39 ms 1612 KB
hand_4.txt 43 ms 1636 KB
hand_5.txt 41 ms 1716 KB
hand_6.txt 40 ms 1592 KB
palindrome_1.txt 23 ms 1048 KB
palindrome_12345.txt 25 ms 1048 KB
palindrome_2.txt 27 ms 1064 KB
palindrome_299998.txt 42 ms 1652 KB
palindrome_299999.txt 41 ms 1704 KB
palindrome_3.txt 28 ms 1020 KB
palindrome_300000.txt 41 ms 1648 KB
palindrome_4.txt 26 ms 1008 KB
palindrome_5.txt 24 ms 1008 KB
palindrome_6789.txt 25 ms 1072 KB
palindrome_67890.txt 28 ms 1088 KB
palindrome_mod_1.txt 27 ms 964 KB
palindrome_mod_1000.txt 25 ms 1060 KB
palindrome_mod_10000.txt 25 ms 1048 KB
palindrome_mod_100001.txt 30 ms 1220 KB
palindrome_mod_2.txt 25 ms 1036 KB
palindrome_mod_200000.txt 36 ms 1388 KB
palindrome_mod_299999.txt 40 ms 1584 KB
palindrome_mod_3.txt 24 ms 1048 KB
palindrome_mod_300000.txt 40 ms 1584 KB
palindrome_mod_4.txt 24 ms 1040 KB
palindrome_mod_5.txt 26 ms 1040 KB
palindrome_mod_50001.txt 28 ms 1196 KB
random_1.txt 25 ms 1072 KB
random_10.txt 24 ms 1068 KB
random_100001.txt 30 ms 1196 KB
random_101.txt 25 ms 1048 KB
random_3000.txt 25 ms 1068 KB
random_300000.txt 39 ms 1584 KB
random_50001.txt 28 ms 1196 KB
sample_1.txt 25 ms 944 KB
sample_2.txt 25 ms 948 KB
sample_3.txt 24 ms 1072 KB