結果
問題 |
No.2073 Concon Substrings (Swap Version)
|
ユーザー |
|
提出日時 | 2022-09-16 22:39:22 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 642 bytes |
コンパイル時間 | 159 ms |
コンパイル使用メモリ | 82,464 KB |
実行使用メモリ | 69,688 KB |
最終ジャッジ日時 | 2024-12-21 21:56:58 |
合計ジャッジ時間 | 3,814 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 5 |
other | AC * 7 WA * 30 |
ソースコード
import sys input = sys.stdin.readline from collections import * N = int(input()) S = input()[:-1] c = [0, 0, 0] o = [0, 0, 0] n = [0, 0, 0] for i in range(3*N): if S[i]=='c': c[i%3] += 1 elif S[i]=='o': o[i%3] += 1 elif S[i]=='n': n[i%3] += 1 ans = 0 now = 0 for _ in range(min(c[0], o[1], n[2])): if now+3<=3*N: now += 3 ans += 1 now += 1 for _ in range(min(c[1], o[2], n[0])): if now+3<=3*N: now += 3 ans += 1 now += 1 for _ in range(min(c[2], o[0], n[1])): if now+3<=3*N: now += 3 ans += 1 now += 1 print(ans)