結果
問題 | No.2073 Concon Substrings (Swap Version) |
ユーザー |
![]() |
提出日時 | 2022-09-19 06:01:23 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 324 ms / 2,000 ms |
コード長 | 384 bytes |
コンパイル時間 | 216 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 12,032 KB |
最終ジャッジ日時 | 2024-12-22 02:19:21 |
合計ジャッジ時間 | 7,772 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 5 |
other | AC * 37 |
ソースコード
LEN=int(input()) S=input() C=[0]*3 O=[0]*3 N=[0]*3 for i in range(LEN*3): if S[i]=="c": C[i%3]+=1 if S[i]=="o": O[i%3]+=1 if S[i]=="n": N[i%3]+=1 ANS=0 ANS+=min(C[0],O[1],N[2]) ANS+=min(C[1],O[2],N[0]) ANS+=min(C[2],O[0],N[1]) if ANS==LEN: if min(C[0],O[1],N[2])==ANS: print(ANS) else: print(ANS-1) else: print(ANS)