結果
| 問題 | No.2073 Concon Substrings (Swap Version) |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-09-17 21:58:37 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 525 bytes |
| 記録 | |
| コンパイル時間 | 194 ms |
| コンパイル使用メモリ | 85,632 KB |
| 実行使用メモリ | 66,048 KB |
| 最終ジャッジ日時 | 2026-05-28 11:56:44 |
| 合計ジャッジ時間 | 5,528 ms |
|
ジャッジサーバーID (参考情報) |
judge2_1 / judge1_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | RE * 5 |
| other | RE * 37 |
ソースコード
N = int(input())
NN *= 3
S = input()
dat = [[0] * 3 for _ in range(3)]
for i in range(NN):
j = i % 3
if S[i] == "c":
dat[j][0] += 1
elif S[i] == "o":
dat[j][1] += 1
elif S[i] == "n":
dat[j][2] += 1
ans = 0
"""
for i in range(3):
ans += min(dat[i][0],dat[(i+1)%3][1],dat[(i+2)%3][2])
"""
ans += min(dat[0][0],dat[1][1],dat[2][2])
t = min(dat[1][0],dat[2][1],dat[0][2])
if t == N:
t -= 1
ans += t
t = min(dat[2][0],dat[0][1],dat[1][2])
if t == N:
t -= 1
ans += t
print(ans)