QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#799677#8248. Is Y a Vowel?WeaRD276#AC ✓0ms3840kbC++201.2kb2024-12-05 17:01:092024-12-05 17:01:09

Judging History

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

  • [2024-12-05 17:01:09]
  • 评测
  • 测评结果:AC
  • 用时:0ms
  • 内存:3840kb
  • [2024-12-05 17:01:09]
  • 提交

answer

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

#define sz(x) (int)(x).size()
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define pb push_back
#define x first
#define y second
#define FOR(i, a, b) for(int i = (a); i < (b); i++)
#define RFOR(i, a, b) for(int i = (a) - 1; i >= (b); i--)

typedef long long ll;
typedef double db;
typedef long double LD;
typedef pair<int, int> pii;
typedef pair<db, db> pdd;
typedef pair<ll, ll> pll;


int solve()
{
	string s;
	if (!(cin >> s))
		return 1;
	
	string vows = "aeiou";
	int n = sz(s);
	int ans = 0;
	FOR (i, 0, n)
	{
		if (count(all(vows), s[i]))
			ans++;
	}
	cout << ans << ' ';
	ans = 0;
	vows += 'y';
	FOR (i, 0, n)
	{
		if (count(all(vows), s[i]))
			ans++;
	}
	cout << ans << '\n';
	
	return 0;
}

int32_t main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	
	int TET = 1e9;
	//cin >> TET;
	for (int i = 1; i <= TET; i++)
	{
		if (solve())
		{
			break;
		}
		#ifdef ONPC
			cerr << "_____________________________\n";
		#endif
	}
	#ifdef ONPC
		cerr << "\nfinished in " << clock() * 1.0 / CLOCKS_PER_SEC << " sec\n";
	#endif
	return 0;
}

详细

Test #1:

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

input:

asdfiy

output:

2 3

result:

ok single line: '2 3'

Test #2:

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

input:

asdeyy

output:

2 4

result:

ok single line: '2 4'

Test #3:

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

input:

y

output:

0 1

result:

ok single line: '0 1'

Test #4:

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

input:

masiwbtuqcbhfebhiehrfynodgmdujstvivcamakuqsulxjfni

output:

14 15

result:

ok single line: '14 15'

Test #5:

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

input:

hbbfiriglpvpzhqgloaezhbbduyeppuydieusencegnaoxigus

output:

17 19

result:

ok single line: '17 19'

Test #6:

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

input:

qwerty

output:

1 2

result:

ok single line: '1 2'

Test #7:

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

input:

yyyyy

output:

0 5

result:

ok single line: '0 5'

Test #8:

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

input:

asde

output:

2 2

result:

ok single line: '2 2'

Test #9:

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

input:

qwqwplkjhgfdsxncmnbvzxc

output:

0 0

result:

ok single line: '0 0'

Test #10:

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

input:

aiuoefgh

output:

5 5

result:

ok single line: '5 5'