結果

問題 No.2073 Concon Substrings (Swap Version)
ユーザー keisuke6
提出日時 2022-09-16 22:20:31
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 356 bytes
コンパイル時間 2,244 ms
コンパイル使用メモリ 202,488 KB
最終ジャッジ日時 2025-02-07 09:58:36
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 5
other AC * 31 WA * 6
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#define int long long
signed main(){
    int N;
    string S;
    cin>>N>>S;
    vector<map<char,int>> M(3);
    for(int i=0;i<3*N;i++){
        M[i%3][S[i]]++;
    }
    cout<<min(min({M[0]['c'],M[1]['o'],M[2]['n']})+min({M[0]['o'],M[1]['n'],M[2]['c'],N-1})+min({M[0]['n'],M[1]['c'],M[2]['o']}),N-1)<<endl;
}
0