結果
| 問題 | No.145 yukiover |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2015-02-19 17:03:30 |
| 言語 | PyPy2 (7.3.20) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 955 bytes |
| 記録 | |
| コンパイル時間 | 127 ms |
| コンパイル使用メモリ | 77,316 KB |
| 最終ジャッジ日時 | 2025-12-03 14:02:56 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 10 WA * 10 |
ソースコード
N = int(raw_input())
S = raw_input()
num = [0]*10
for s in S:
if s < "i": num[0] += 1
elif s == "i": num[1] += 1
elif s < "k": num[2] += 1
elif s == "k": num[3] += 1
elif s < "u": num[4] += 1
elif s == "u": num[5] += 1
elif s < "y": num[6] += 1
elif s == "y": num[7] += 1
elif s > "y": num[8] += 1
ans = 0
ans += num[8]
while num[7]:
if num[6] > 0: num[6] -= 1; ans += 1; continue
elif num[5] > 0:
num[5] -= 1
if num[4] > 0: num[4] -= 1; ans += 1; continue
elif num[3] > 0:
num[3] -= 1
if num[2] > 0: num[2] -= 1; ans += 1; continue
elif num[1] > 0:
num[1] -= 1
if num[0] > 0: num[0] -= 1; ans += 1; continue
if num[1] > 0: num[1] -= 1; ans += 1; continue
if num[3] > 0: num[3] -= 1; ans += 1; continue
if num[5] > 0: num[5] -= 1; ans += 1; continue
num[7] -= 1
print ans