Pagini recente » Cod sursa (job #761979) | Cod sursa (job #1561250) | Cod sursa (job #1231270) | Cod sursa (job #674252) | Cod sursa (job #3225499)
#include <bits/stdc++.h>
using namespace std;
ifstream fin("pscpld.in");
ofstream fout("pscpld.out");
char c[1000002];
int n, i, r;
static inline void Calc(int st, int dr) {
while(1 <= st && dr <= n && c[st] == c[dr]) {
r++;
st--;
dr++;
}
}
int main() {
fin >> (c + 1);
n = strlen(c + 1);
for(i = 1; i <= n; i++) {
Calc(i, i);
Calc(i, i + 1);
}
fout << r;
return 0;
}