結果

問題 No.2073 Concon Substrings (Swap Version)
ユーザー 👑 NachiaNachia
提出日時 2022-09-16 22:35:54
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 926 bytes
コンパイル時間 665 ms
コンパイル使用メモリ 79,644 KB
実行使用メモリ 4,508 KB
最終ジャッジ日時 2023-08-23 16:10:38
合計ジャッジ時間 6,739 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 RE -
testcase_06 RE -
testcase_07 WA -
testcase_08 RE -
testcase_09 RE -
testcase_10 RE -
testcase_11 RE -
testcase_12 WA -
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
testcase_16 RE -
testcase_17 WA -
testcase_18 RE -
testcase_19 RE -
testcase_20 RE -
testcase_21 RE -
testcase_22 RE -
testcase_23 WA -
testcase_24 RE -
testcase_25 RE -
testcase_26 RE -
testcase_27 WA -
testcase_28 RE -
testcase_29 RE -
testcase_30 RE -
testcase_31 RE -
testcase_32 RE -
testcase_33 RE -
testcase_34 RE -
testcase_35 RE -
testcase_36 RE -
testcase_37 RE -
testcase_38 RE -
testcase_39 RE -
testcase_40 RE -
testcase_41 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <queue>
#include <atcoder/modint>

using namespace std;
using i32 = int32_t;
using u32 = uint32_t;
using i64 = int64_t;
using u64 = uint64_t;
#define rep(i,n) for(int i=0; i<(int)(n); i++)

using Modint = atcoder::static_modint<998244353>;


int main(){
rep(t,5){
    int C[3][3] = {};
    string con = "con";
    int N; cin >> N;
    N *= 3;
    string S; cin >> S;
    rep(i,N){
        auto p = con.find(S[i]);
        if(p != string::npos) C[i%3][p]++;
    }
    int ans = 0;
    int q = N;
    rep(t,3){
        int con = min({ q/3, C[(0+t)%3][0], C[(1+t)%3][1], C[(2+t)%3][2] });
        ans += con;
        q -= con * 3 + 1;
    }
    cout << ans << '\n';
}
    return 0;
}


struct ios_do_not_sync{
    ios_do_not_sync(){
        std::ios::sync_with_stdio(false);
        std::cin.tie(nullptr);
    }
} ios_do_not_sync_instance;


0