結果
| 問題 | No.2073 Concon Substrings (Swap Version) |
| コンテスト | |
| ユーザー |
ニックネーム
|
| 提出日時 | 2022-09-16 22:07:49 |
| 言語 | Python3 (3.14.3 + numpy 2.4.4 + scipy 1.17.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 336 bytes |
| 記録 | |
| コンパイル時間 | 520 ms |
| コンパイル使用メモリ | 20,696 KB |
| 実行使用メモリ | 16,220 KB |
| 最終ジャッジ日時 | 2026-05-28 10:06:57 |
| 合計ジャッジ時間 | 5,910 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 5 |
| other | AC * 25 WA * 12 |
ソースコード
m = int(input())
s = input()
c = [s[i::3].count("c") for i in range(3)]
o = [s[i::3].count("o") for i in range(3)]
n = [s[i::3].count("n") for i in range(3)]
ans = [min(c[i], o[(i+1)%3], n[(i+2)%3]) for i in range(3)]
if ans[1] and ans[2]: print(min(sum(ans), m-2))
elif ans[1] or ans[2]: print(min(sum(ans), m-1))
else: print(sum(ans))
ニックネーム