Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define _CRT_SECURE_NO_WARNINGS
- #include <iostream>
- #include <cstdio>
- #include <cstdlib>
- #include <cassert>
- #include <cmath>
- #include <algorithm>
- #include <vector>
- #include <map>
- #include <set>
- #include <string>
- #include <queue>
- #include <stack>
- #include <deque>
- #include <time.h>
- using namespace std;
- #define forn(i,n) for (int i = int(0); i < int(n); i++)
- #define forb(i,n) for (int i = int(n-1); i >= int(0); i--)
- #define for1(i,n) for (int i = int(1); i <= int(n); i++)
- #define fore(i,a,n) for (int i = int(a); i < int(n); i++)
- #define pb push_back
- #define mp make_pair
- #define fr first
- #define sc second
- #define sz size()
- #define sqr(x) ((x)*(x))
- #define cube(x) ((x)*(x)*(x))
- #define all(x) x.begin(), x.end()
- #define rall(x) x.rbegin(), x.rend()
- #define min3(a, b, c) min(a, min(b, c))
- #define max3(a, b, c) max(a, max(b, c))
- #define dist(x1, y1, x2, y2) sqrt(ld (sqr(x1 - x2) + sqr(y1 - y2)))
- typedef long long ll;
- typedef long double ld;
- typedef unsigned long long ull;
- const int maxn = 1000;
- const int MAXN = 30001;
- const int logn = 12;
- const int inf = (int) 1e9;
- const int alpha = 26;
- const int my_hash = 31;
- const long long base = (ll) 1e9;
- const long long my_mod = 2674894331;
- const long long l_inf = (ll) 4e18;
- const long long mod = (ll) 1e9 + 7;
- const long long l_mod = (ll) 1e18 - 11;
- const double fi = (sqrt(5.0) + 1) / 2.0;
- const double pi = acos(-1.0);
- const double eps = 1e-8;
- const double EPS = 0.00005;
- char isSimple[6] = {'E', 'Y', 'U', 'I', 'O', 'A'};
- bool simple(char symb) {
- for (int i = 0; i < 6; i++)
- if (isSimple[i] == symb)
- return true;
- return false;
- }
- int main() {
- //srand(time(NULL));
- char symb;
- vector<long long> cnt(1, 0);
- while (scanf("%c ", &symb) != EOF) {
- bool check = simple(symb);
- cnt.pb(check ? 1ll : 0ll);
- }
- int n = int(cnt.sz) - 1;
- for (int i = 1; i <= n; i++)
- cnt[i] += cnt[i - 1];
- vector<long long> len(n + 1, 0);
- len[1] += cnt[n];
- for (int l = 2; l <= n; l++)
- len[l] = len[l - 1] - (cnt[n] - cnt[n - l + 1]) + (cnt[n] - cnt[l - 1]);
- double res = 0.0;
- for (int l = 1; l <= n; l++)
- res += double(len[l]) / double(l);
- printf("%.10lf", res);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement