This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <iostream>
#include <string>
using namespace std;
using i64 = long long int;
#define ALL(x) (x).begin(), (x).end()
#define REP(i, N) for (int i = 0; i < (N); ++i)
#define REP_3(i, l, r) for (int i = (l); i < (r); ++i)
void answer(const i64 x) {
cout << x / 2;
if (x % 2 == 1) cout << ".5" << endl;
}
int main() {
string S;
cin >> S;
const int N = (int)S.size();
i64 sum = 0;
REP(i, N) {
const int x = min(i, N - i - 1);
sum += x;
}
answer(sum);
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |