QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#343257#8248. Is Y a Vowel?MayaZayn#AC ✓0ms3884kbC++141.1kb2024-03-02 12:00:232024-03-02 12:00:23

Judging History

你现在查看的是最新测评结果

  • [2024-03-02 12:00:23]
  • 评测
  • 测评结果:AC
  • 用时:0ms
  • 内存:3884kb
  • [2024-03-02 12:00:23]
  • 提交

answer

#include <bits/stdc++.h>
#define MayaZayn ios::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
#define ll long long
#define endl '\n'
#define all(x) (x).begin(), (x).end()
#define all_r(x) (x).rbegin(), (x).rend()
#define mnEl(vec) *min_element(vec.begin(), vec.end())
#define mxEl(vec) *max_element(vec.begin(), vec.end())
#define yes cout << "YES"
#define no cout << "NO"
#define in(v) for (auto & x : v) cin >> x
#define out(v) for (auto & x : v) cout << x << ' '
#define inLL(v) for (ll & x : v) cin >> x
#define openIn(x) freopen(x, "r", stdin);
#define openOut(x) freopen(x, "w", stdout);
#define M 1000000007
#define N 10005

using namespace std;

void solve() {
    string s;
    cin >> s;
    vector<char> v{'e', 'a', 'o', 'u', 'i'};
    int cnt = 0, yCnt = 0;
    for (int i = 0; i < s.size(); ++i) {
        if (find(all(v), s[i]) != v.end())
            cnt++;
        else if (s[i] == 'y')
            yCnt++;
    }
    cout << cnt << ' ' << cnt + yCnt;
}

int main() {
    MayaZayn

//    int t;
//    cin >> t;
//    while (t--)
        solve();

    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 3632kb

input:

asdfiy

output:

2 3

result:

ok single line: '2 3'

Test #2:

score: 0
Accepted
time: 0ms
memory: 3868kb

input:

asdeyy

output:

2 4

result:

ok single line: '2 4'

Test #3:

score: 0
Accepted
time: 0ms
memory: 3632kb

input:

y

output:

0 1

result:

ok single line: '0 1'

Test #4:

score: 0
Accepted
time: 0ms
memory: 3580kb

input:

masiwbtuqcbhfebhiehrfynodgmdujstvivcamakuqsulxjfni

output:

14 15

result:

ok single line: '14 15'

Test #5:

score: 0
Accepted
time: 0ms
memory: 3628kb

input:

hbbfiriglpvpzhqgloaezhbbduyeppuydieusencegnaoxigus

output:

17 19

result:

ok single line: '17 19'

Test #6:

score: 0
Accepted
time: 0ms
memory: 3640kb

input:

qwerty

output:

1 2

result:

ok single line: '1 2'

Test #7:

score: 0
Accepted
time: 0ms
memory: 3804kb

input:

yyyyy

output:

0 5

result:

ok single line: '0 5'

Test #8:

score: 0
Accepted
time: 0ms
memory: 3884kb

input:

asde

output:

2 2

result:

ok single line: '2 2'

Test #9:

score: 0
Accepted
time: 0ms
memory: 3532kb

input:

qwqwplkjhgfdsxncmnbvzxc

output:

0 0

result:

ok single line: '0 0'

Test #10:

score: 0
Accepted
time: 0ms
memory: 3868kb

input:

aiuoefgh

output:

5 5

result:

ok single line: '5 5'