Educational Codeforces Round 96 D問題 - String Deletion

Source

Educational Codeforces Round 96 D問題
Problem description

問題概要

省略

解法

省略

cLayversion 20201102-1)のコード

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

//no-unlocked
int N;
char S[2d5+2];
int sz, len[2d5];
{
  REP(rd_int()){
    int i, res = 0;
    rd(N,S);
    sz = runLength(N,S,NULL,len);
    reverse(len, len+sz);
    i = sz;
    while(sz > 0){
      res++;
      i <?= sz-1;
      while(i >= 0 && len[i] == 1) i--;
      sz--;
      if[i>=0, len[i], sz]--;
    }
    wt(res);
  }
}

Current time: 2024年04月20日05時30分01秒
Last modified: 2020年11月03日23時02分04秒 (by laycrs)
Tags: Competitive_Programming_Incomplete Codeforces
トップページに戻る

Logged in as: unknown user (not login)

ログイン: