保存されている過去のバージョンの一覧

2019年07月21日15時47分06秒

Codeforces Global Round 4 E問題 - Archaeology

Source

Codeforces Global Round 4 E問題 (2000pt)
Problem description

問題概要

省略

解法

省略

cLayversion 20190721-1)のコード

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

//no-unlocked
char S[1000002]; int N;

char res[1000002]; int len;
char tmp[1000002]; int tmps;
{
  int i, j, k;
  int a, b;

  rd(S@N);
  a = 0;
  b = N-1;
  while(a <= b){
    if(a==b){
      res[len++] = S[a];
      break;
    }
    
    if(S[a]==S[b]){
      res[len++] = S[a];
      tmp[tmps++] = S[b];
      a++; b--;
      continue;
    }

    if(S[a+1] == S[b]){
      a++; continue;
    }

    if(S[a] == S[b-1]){
      b--; continue;
    }

    a++; b--;
  }

  while(tmps) res[len++] = tmp[--tmps];
  wt(res);
}

Current time: 2024年04月19日17時04分27秒
Last modified: 2019年07月21日15時47分06秒 (by laycrs)
Tags: Competitive_Programming_Incomplete Codeforces Codeforces_Global_Round_4
トップページに戻る

Logged in as: unknown user (not login)

ログイン: