結果
| 問題 | No.2073 Concon Substrings (Swap Version) | 
| コンテスト | |
| ユーザー |  qwewe | 
| 提出日時 | 2025-04-24 12:27:00 | 
| 言語 | PyPy3 (7.3.15) | 
| 結果 | 
                                WA
                                 
                             | 
| 実行時間 | - | 
| コード長 | 496 bytes | 
| コンパイル時間 | 149 ms | 
| コンパイル使用メモリ | 81,792 KB | 
| 実行使用メモリ | 77,184 KB | 
| 最終ジャッジ日時 | 2025-04-24 12:27:49 | 
| 合計ジャッジ時間 | 3,306 ms | 
| ジャッジサーバーID (参考情報) | judge4 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 5 | 
| other | AC * 17 WA * 20 | 
ソースコード
n = int(input())
s = input().strip()
# Initialize counts for 'c', 'o', 'n' in each of the three groups (0, 1, 2)
c = [0, 0, 0]
o = [0, 0, 0]
n_ = [0, 0, 0]
for i in range(len(s)):
    group = i % 3
    char = s[i]
    if char == 'c':
        c[group] += 1
    elif char == 'o':
        o[group] += 1
    elif char == 'n':
        n_[group] += 1
# Calculate the maximum possible 'con' substrings
max_con = min(c[0], o[1], n_[2]) + min(c[1], o[2], n_[0]) + min(c[2], o[0], n_[1])
print(max_con)
            
            
            
        