結果

問題 No.2997 Making YuzuKizu
ユーザー elphe
提出日時 2024-12-27 20:04:41
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 10 ms / 2,000 ms
コード長 813 bytes
コンパイル時間 3,565 ms
コンパイル使用メモリ 85,764 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-12-27 20:04:46
合計ジャッジ時間 2,644 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 17
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <cstdint>
#include <algorithm>

using namespace std;

int main()
{
	cin.tie(nullptr);
	ios::sync_with_stdio(false);
	
	char S[1000001];
	cin >> S;

	int32_t count[7] = { 0, 0, 0, 0, 0, 0, 0 };
	for (int32_t i = 0; ; ++i)
		switch(S[i])
		{
		case 'a':
			++count[0];
			break;

		case 'i':
			++count[1];
			break;

		case 'k':
			++count[2];
			break;

		case 'r':
			++count[3];
			break;

		case 'u':
			++count[4];
			break;

		case 'y':
			++count[5];
			break;

		case 'z':
			++count[6];
			break;

		case '\0':
			cout << min({ count[0], count[1], count[2], count[3], count[4], count[5] }) << ' '
				<< min({ count[0] / 2, count[1], count[2], count[3] }) << ' '
				<< min({ count[1], count[2], count[4] / 3, count[5], count[6] / 2 }) << '\n';
			return 0;
		}

	return -1;
}
0