結果

問題 No.2073 Concon Substrings (Swap Version)
ユーザー Akijin_007Akijin_007
提出日時 2022-09-16 22:25:48
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 106 ms / 2,000 ms
コード長 556 bytes
コンパイル時間 255 ms
コンパイル使用メモリ 86,924 KB
実行使用メモリ 78,032 KB
最終ジャッジ日時 2023-08-23 16:03:43
合計ジャッジ時間 5,506 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 68 ms
71,008 KB
testcase_01 AC 68 ms
71,156 KB
testcase_02 AC 68 ms
71,136 KB
testcase_03 AC 67 ms
70,920 KB
testcase_04 AC 68 ms
71,376 KB
testcase_05 AC 101 ms
77,788 KB
testcase_06 AC 92 ms
77,628 KB
testcase_07 AC 68 ms
71,188 KB
testcase_08 AC 89 ms
77,072 KB
testcase_09 AC 87 ms
77,320 KB
testcase_10 AC 104 ms
77,608 KB
testcase_11 AC 106 ms
78,032 KB
testcase_12 AC 70 ms
71,176 KB
testcase_13 AC 85 ms
76,164 KB
testcase_14 AC 103 ms
77,588 KB
testcase_15 AC 87 ms
76,532 KB
testcase_16 AC 97 ms
77,548 KB
testcase_17 AC 71 ms
70,928 KB
testcase_18 AC 80 ms
76,084 KB
testcase_19 AC 95 ms
77,612 KB
testcase_20 AC 93 ms
77,348 KB
testcase_21 AC 92 ms
76,884 KB
testcase_22 AC 98 ms
77,824 KB
testcase_23 AC 70 ms
71,332 KB
testcase_24 AC 81 ms
76,036 KB
testcase_25 AC 91 ms
77,044 KB
testcase_26 AC 98 ms
77,648 KB
testcase_27 AC 70 ms
71,180 KB
testcase_28 AC 93 ms
77,228 KB
testcase_29 AC 83 ms
76,788 KB
testcase_30 AC 89 ms
77,156 KB
testcase_31 AC 85 ms
76,516 KB
testcase_32 AC 82 ms
76,056 KB
testcase_33 AC 83 ms
76,228 KB
testcase_34 AC 85 ms
76,080 KB
testcase_35 AC 90 ms
76,776 KB
testcase_36 AC 85 ms
76,192 KB
testcase_37 AC 88 ms
76,816 KB
testcase_38 AC 83 ms
76,120 KB
testcase_39 AC 90 ms
76,920 KB
testcase_40 AC 91 ms
76,856 KB
testcase_41 AC 91 ms
76,808 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#int(input())
#map(int, input().split())
#list(map(int, input().split()))

N = int(input())
S = input()
m = 3 * N

a = ("c", "o", "n")
c = [[0] * 3 for i in range(3)]

for i in range(m):
    if S[i] in a:
        t = a.index(S[i])
        c[i%3][t] += 1

# for i in range(3):
#     print(c[i])

ans = 0
u = []
for i in range(3):
    b = 1000000
    for j in range(3):
        b = min(c[(i+j)%3][j], b)
        # print((i+j)%3, j)
    u.append(b)

if sum(u) == N:
    if u[0] == N:
        print(u[0])
    else:
        print(N-1)
else:
    print(sum(u))


0