Educational Codeforces Round 97 B問題 - Reverse Binary Strings

Source

Educational Codeforces Round 97 B問題
Problem description

問題概要

省略

解法

省略

cLayversion 20201102-1)のコード

C++に変換後のコードはこちら

//no-unlocked
int N;
char S[1d5+2];
{
  REP(rd_int()){
    int res1 = 0, res2 = 0;
    rd(N,S);
    rep(i,1,N) if(S[i]==S[i-1]=='0') res1++;
    rep(i,1,N) if(S[i]==S[i-1]=='1') res2++;
    wt(max(res1,res2));
  }
}

Current time: 2024年04月25日15時24分37秒
Last modified: 2020年11月03日21時49分08秒 (by laycrs)
Tags: Competitive_Programming_Incomplete Codeforces
トップページに戻る

Logged in as: unknown user (not login)

ログイン: