結果
| 問題 | No.2073 Concon Substrings (Swap Version) | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2023-08-02 00:31:19 | 
| 言語 | PyPy3 (7.3.15) | 
| 結果 | 
                                WA
                                 
                             | 
| 実行時間 | - | 
| コード長 | 271 bytes | 
| コンパイル時間 | 235 ms | 
| コンパイル使用メモリ | 82,176 KB | 
| 実行使用メモリ | 104,952 KB | 
| 最終ジャッジ日時 | 2024-10-11 20:06:05 | 
| 合計ジャッジ時間 | 5,503 ms | 
| ジャッジサーバーID (参考情報) | judge4 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 5 | 
| other | AC * 17 WA * 20 | 
ソースコード
from collections import defaultdict
n = int(input())
S = list(input())
C = [defaultdict(int) for _ in range(3)]
for i in range(3 * n):
    C[i % 3][S[i]] += 1
ans = 0
for i in range(3):
    ans += min(C[i % 3]['c'], C[(i + 1) % 3]['o'], C[(i + 2) % 3]['n'])
print(ans)
            
            
            
        