Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #pragma comment(linker, "/STACK:268435456")
- #include <iostream>
- #include <sstream>
- #include <stdio.h>
- #include <stdlib.h>
- #include <string>
- #include <algorithm>
- #include <vector>
- #include <math.h>
- #include <set>
- #include <map>
- #include <queue>
- #include <iomanip>
- #include <assert.h>
- #include <stack>
- #include <deque>
- #include <limits.h>
- #include <memory.h>
- #include <ctime>
- //#include <unordered_map>
- //#include <unordered_set>
- using namespace std;
- void prepare(string q) {
- #ifdef _DEBUG
- //system("color F0");
- freopen("input.txt","r",stdin);
- //freopen("output.txt","w",stdout);
- #else
- if (q.size()!=0)
- {
- freopen((q+".in").c_str(),"r",stdin);
- freopen((q+".out").c_str(),"w",stdout);
- }
- #endif
- cin.sync_with_stdio(false);
- cout.sync_with_stdio(false);
- cin.tie(false);
- }
- const int SZ = 50;
- #define ppb push_back
- #define sz(a) (int)a.size()
- #define mp make_pair
- #define all(a) a.begin(), a.end()
- void solve()
- {
- string s;
- cin>>s;
- vector <bool> v(255,false);
- vector <bool> c(255,false);
- v['A']=true;
- v['E']=true;
- v['I']=true;
- v['O']=true;
- v['U']=true;
- bool nice=false, ugly=false,ugly1=false;
- bool ki=false;
- int gl=0,sgl=0;
- //UGLY
- //gl
- for (int i=0; i<s.size(); ++i)
- {
- if (s[i]=='?')
- {
- ++gl;
- continue;
- }
- if (v[s[i]]) ++gl;
- else gl=0;
- if (gl>=3)
- ugly=true;
- }
- //sgl
- for (int i=0; i<s.size(); ++i)
- {
- if (s[i]=='?')
- {
- ++sgl;
- continue;
- }
- if (!v[s[i]]) ++sgl;
- else sgl=0;
- if (sgl>=5)
- ugly=true;
- }
- //nothing
- gl=sgl=0;
- for (int i=0; i<s.size(); ++i)
- {
- if (s[i]=='?')
- {
- continue;
- }
- if (!v[s[i]])
- {
- gl=0;
- ++sgl;
- }
- else
- {
- sgl=0;
- ++gl;
- }
- if (gl>=3 || sgl>=5)
- ugly1=true;
- }
- //NICE
- sgl=gl=0;
- for (int i=0; i<s.size(); ++i)
- {
- if (s[i]=='?')
- {
- if (gl==2)
- {
- sgl=1;
- gl=0;
- continue;
- }
- if (sgl==4)
- {
- gl=1;
- sgl=0;
- continue;
- }
- int g=0,c=0;
- for (int j=i+1; j<s.size(); ++j)
- {
- if (s[i]=='?') break;
- if (v[s[i]]) ++g;
- else break;
- }
- for (int j=i+1; j<s.size(); ++j)
- {
- if (s[i]=='?') break;
- if (!v[s[i]]) ++c;
- else break;
- }
- }
- if (v[s[i]])
- {
- ++gl;
- sgl=0;
- }
- else
- {
- ++sgl;
- gl=0;
- }
- }
- }
- int main()
- {
- prepare("");
- solve();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement