Codeforces Round #721 DIV2 B2問題 - Palindrome Game (hard version)

Source

Codeforces Round #721 DIV2 B2問題 (1500pt)
Problem description

問題概要

省略

解法

省略

cLayversion 20210405-1)のコード

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

//no-unlocked
int N; char S[1002];
{
  REP(rd_int()){
    int cnt, cen;
    rd(N,S);
    cnt = arrCountVal(N,S,'0');
    cen = if[N%2==1 && S[N/2]=='0', 1, 0];

    if(cnt==0) wt("DRAW"), continue;
    if(!isPalindrome(N,S)) wt(if[cen && cnt==2, "DRAW", "ALICE"]), continue;
    if(cen) wt(if[cnt==1, "BOB", cnt==2, "DRAW", "ALICE"]), continue;
    wt("BOB");
  }
}

Current time: 2024年03月29日23時48分50秒
Last modified: 2021年05月21日20時46分40秒 (by laycrs)
Tags: Competitive_Programming_Incomplete Codeforces CF721 CF_DIV2_B
トップページに戻る

Logged in as: unknown user (not login)

ログイン: