結果

問題 No.2997 Making YuzuKizu
ユーザー 2qbingxuan
提出日時 2024-12-22 03:11:01
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 27 ms / 2,000 ms
コード長 412 bytes
コンパイル時間 3,091 ms
コンパイル使用メモリ 246,604 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-12-22 03:11:05
合計ジャッジ時間 4,126 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 17
権限があれば一括ダウンロードができます

ソースコード

diff #

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

signed main() {
	string s;
	cin >> s;
	for (bool first = true; string p : {"yukari"s, "akari"s, "yuzukizu"s}) {
		int f[256] = {}, z[256] = {};
		for (char c : p) f[c] += 1;
		for (char c : s) z[c] += 1;
		int ans = 1e9;
		for (int i = 0; i < 256; i++)
			if (f[i])
				ans = min(ans, z[i] / f[i]);
		if (!first)
			cout << ' ';
		first = false;
		cout << ans;
	}
}
0