QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#343738#8248. Is Y a Vowel?EsraaSyam#AC ✓0ms3880kbC++201.0kb2024-03-02 23:23:062024-03-02 23:23:06

Judging History

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

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

answer

#include "bits/stdc++.h"
using namespace std;

#define nl "\n"
#define ll long long
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
#define sz(v) (int) v.size()

template<typename T = int>
istream &operator>>(istream &in, vector<T> &v) {
    for (auto &x: v) in >> x;
    return in;
}

template<typename T = int>
ostream &operator<<(ostream &out, const vector<T> &v) {
    for (const T &x: v) out << x << " ";
    return out;
}

void Sira() {
    ios_base::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin), freopen("output.txt", "w", stdout);
#endif
}

void solve(){
    string s;
    cin >> s;
    ll ans = count(all(s), 'a') + count(all(s), 'e') + count(all(s), 'i') + count(all(s), 'o') + count(all(s), 'u');

    cout << ans  << " " << ans + count(all(s), 'y') << nl;

}

int main() {
    Sira();
    int t = 1;
//    cin >> t;
    while(t--){
        solve();
    }
    return 0;
}

详细

Test #1:

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

input:

asdfiy

output:

2 3

result:

ok single line: '2 3'

Test #2:

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

input:

asdeyy

output:

2 4

result:

ok single line: '2 4'

Test #3:

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

input:

y

output:

0 1

result:

ok single line: '0 1'

Test #4:

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

input:

masiwbtuqcbhfebhiehrfynodgmdujstvivcamakuqsulxjfni

output:

14 15

result:

ok single line: '14 15'

Test #5:

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

input:

hbbfiriglpvpzhqgloaezhbbduyeppuydieusencegnaoxigus

output:

17 19

result:

ok single line: '17 19'

Test #6:

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

input:

qwerty

output:

1 2

result:

ok single line: '1 2'

Test #7:

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

input:

yyyyy

output:

0 5

result:

ok single line: '0 5'

Test #8:

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

input:

asde

output:

2 2

result:

ok single line: '2 2'

Test #9:

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

input:

qwqwplkjhgfdsxncmnbvzxc

output:

0 0

result:

ok single line: '0 0'

Test #10:

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

input:

aiuoefgh

output:

5 5

result:

ok single line: '5 5'