結果
問題 |
No.2073 Concon Substrings (Swap Version)
|
ユーザー |
![]() |
提出日時 | 2022-09-18 19:27:51 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 371 bytes |
コンパイル時間 | 379 ms |
コンパイル使用メモリ | 82,428 KB |
実行使用メモリ | 104,456 KB |
最終ジャッジ日時 | 2024-12-22 01:37:58 |
合計ジャッジ時間 | 4,585 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 5 |
other | AC * 17 WA * 20 |
ソースコード
N = int(input()) S = input() X = [[0] * 3 for _ in range(3)] for i, c in enumerate(list(S)): if c == "c": X[i % 3][0] += 1 if c == "o": X[(i - 1) % 3][1] += 1 if c == "n": X[(i - 2) % 3][2] += 1 ans = 0 usable = 3 * N for i in range(3): tmp = min(min(X[i]), usable // 3) ans += tmp usable -= min(3 * tmp + 1, 0) print(ans)