To the Expert

menu-opener icon
  • 홈
  • 태그
  • 방명록
반응형
Educational Codeforces Round 116 - A. AB Balance 포스팅 썸네일 이미지

알고리즘/codeforces

Educational Codeforces Round 116 - A. AB Balance

문제 설명 문자 a와 b로만 이루어져 있는 길이가 $n$인 문자열 $s$가 주어진다. $AB(s)$를 $s$의 substring 인 ab의 출현 횟수라고 하고, $BA(s)$를 $s$의 substring 인 ba의 출현 횟수라고 하자. 한 단계에서 우리는 index $i$를 선택하고 $s_i$를 문자 a나 b로 바꿀 수 있다. $AB(s) = BA(s)$ 가 되기 위해서 필요한 최소 연산은 무엇일까? Input 첫번째 줄에는 테스트 케이스의 개수를 나타내는 정수 $t (1 \le t \le 1000)$ 이 주어진다. 각 테스트케이스의 첫번째 줄에는 문자열 $s (1 \le |s| \le 100)$ 가 주어진다. 이때 $|s|$ 는 문자열 $s$의 길이를 의미하고 이 문자열은 a와 b로만 이루어져 있다. ..

2021.12.17 게시됨

1
반응형
반응형

공지사항

최근글

인기글

최근 작성된 댓글

태그 클라우드

  • Educational Codeforces Round 116
  • B. Update Files
  • Codeforces Round #748 (Div. 3)
  • A. AB Balance
  • ABC205
  • Codeforces Round #746 (Div. 2)
  • CodeForces
  • Codeforces Round #743 (Div. 2)
  • C. Banknotes
  • Codeforces Round #745 (Div. 2)
  • Atcoder
  • Codeforces Round #747 (Div. 2)
  • Educational Codeforces Round 114 (Rated for Div. 2)
  • Educational Codeforces Round 113 (Rated for Div. 2)
  • Codeforces Round #742 (Div. 2)
  • Codeforces Round #744 (Div. 3)
  • Codeforces Round #750 (Div. 2)
  • Codeforces Round #751 (Div. 2)
  • Educational Codeforces Round 115 (Rated for Div. 2)
  • ABC206
Copyright . 베이스캠프 all rights reserved.
Designed by 베이스캠프
닫기 아이콘
사이드 프로필 배경이미지
블로그 이미지

falconlee236

  • 분류 전체보기 (136)
    • 논문 리뷰 (2)
    • BOAZ (3)
    • 알고리즘 (112)
      • codeforces (86)
      • atcoder (26)
      • baekjoon (0)
    • IT서적 (6)
    • VanillaJS (8)
    • React (1)
    • 개발 (2)

전체

오늘

어제

Designed by 베이스캠프

티스토리툴바