結果

問題 No.145 yukiover
ユーザー roiti46roiti46
提出日時 2015-02-19 17:03:30
言語 Python2
(2.7.18)
結果
WA  
実行時間 -
コード長 955 bytes
コンパイル時間 230 ms
コンパイル使用メモリ 6,680 KB
実行使用メモリ 6,160 KB
最終ジャッジ日時 2023-09-06 02:24:06
合計ジャッジ時間 2,806 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 10 ms
5,920 KB
testcase_01 AC 10 ms
5,852 KB
testcase_02 AC 10 ms
5,960 KB
testcase_03 AC 11 ms
6,016 KB
testcase_04 AC 11 ms
5,852 KB
testcase_05 AC 11 ms
6,052 KB
testcase_06 AC 11 ms
6,064 KB
testcase_07 AC 11 ms
5,816 KB
testcase_08 WA -
testcase_09 AC 10 ms
6,020 KB
testcase_10 WA -
testcase_11 AC 23 ms
5,948 KB
testcase_12 AC 51 ms
6,160 KB
testcase_13 AC 55 ms
6,108 KB
testcase_14 AC 60 ms
5,928 KB
testcase_15 WA -
testcase_16 AC 52 ms
6,128 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

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
0