Codeforces Good Bye 2021: 2022 is NEAR B問題 - Mirror in the String

Source

Codeforces Good Bye 2021: 2022 is NEAR B問題 (1000pt)
Problem description

問題概要

省略

解法

省略

cLay(version 20211231-1)のコード

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

//no-unlocked
REP(rd_int()){
  int @N; char @S[N], res[2*N+1] = {};
  int i, j;
  if(N==1 || S[0]==S[1]){
    res[0] = res[1] = S[0];
    wt(res);
    continue;
  }
  rep(j,1,N) if(S[j-1] < S[j]) break;
  rep(i,j) res[i] = S[i];
  rep(i,j) res[i+j] = S[j-1-i];
  wt(res);
}

Current time: 2024年05月19日07時15分46秒
Last modified: 2021年12月31日18時01分07秒 (by laycrs)
Tags: Competitive_Programming_Incomplete Codeforces Codeforces_Good_Bye_2021
トップページに戻る

Logged in as: unknown user (not login)

ログイン: