Educational Codeforces Round 102 B問題 - String LCM

Source

Educational Codeforces Round 102 B問題
Problem description

問題概要

省略

解法

省略

cLayversion 20210227-1)のコード

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

//no-unlocked
{
  REP(rd_int()){
    string @S, @T, ss, tt;
    int g = gcd(S.size(), T.size());
    rep(T.size()/g) ss += S;
    rep(S.size()/g) tt += T;
    wt(if[ss==tt, ss, -1]);
  }
}

Current time: 2024年04月20日16時50分38秒
Last modified: 2021年02月27日13時03分53秒 (by laycrs)
Tags: Competitive_Programming_Incomplete Codeforces
トップページに戻る

Logged in as: unknown user (not login)

ログイン: