結果
| 問題 |
No.145 yukiover
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2015-02-19 17:07:03 |
| 言語 | Python2 (2.7.18) |
| 結果 |
AC
|
| 実行時間 | 62 ms / 5,000 ms |
| コード長 | 1,014 bytes |
| コンパイル時間 | 193 ms |
| コンパイル使用メモリ | 7,040 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-06-23 21:20:17 |
| 合計ジャッジ時間 | 1,693 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 20 |
ソースコード
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]:
num[7] -= 1
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
if num[7] > 0: num[7] -= 1; ans += 1; continue
print ans