Logo
(追記) (追記ここまで)

23414번 - Removing Pairs 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 (추가 시간 없음) 512 MB78483957.353%

문제

The pair removal operation is removing two adjacent characters from a string. For example, given the string "abcd", we can obtain "ab", "ad", and "cd" by pair removal.

You are given a string $t$. You can apply pair removal any number of times. Is it possible to obtain the string $s$?

입력

The first line contains the string $s,ドル and the second line contains the string $t$ (1ドル \le |s| \le |t| \le 10^5$). Both strings are composed of lowercase letters of English alphabet.

출력

Print "YES" if it is possible to obtain $s$ from $t$ using pair removal, or "NO" otherwise.

제한

예제 입력 1

axa
abcbcxdda

예제 출력 1

YES

예제 입력 2

rrr
rdfgdfgrdr

예제 출력 2

NO

예제 입력 3

w
uwwu

예제 출력 3

NO

노트

In the first test, one of the possible pair removal sequences is the following:

  • abcbcxdda
  • abcxdda
  • abcxa
  • axa

출처

Contest > Open Cup > 2019/2020 Season > Stage 3: Grand Prix of SPb I번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /