RiseOJ는 solved.ac와 제휴 관계가 없습니다. 티어 아이콘 © solved.ac. solved.ac
포럼
USACO0509

Blocks

Bronze II 브론즈 II
난이도
2s
시간 제한
256MB
메모리 제한
0
맞았습니다!!
0
제출 수
0.0%
정답률
레이팅

의견: 0

설명

In an effort to improve her vocabulary, Bessie the cow has obtained a set of
four wooden blocks, each one a cube with a letter of the alphabet written on
each of its six sides. She is learning how to spell by arranging the blocks in
a row so the letters on top of the blocks spell words.

Given the letters on each of Bessie's four blocks, and a list of words she would
like to spell, please determine which of words on her list she will be able to
spell successfully using the blocks.

Problem credits: Brian Dean

제약

Problem credits: Brian Dean

입력 형식

The first line of input contains \(N\) (\(1\le N\le 10\)), the number of words that
Bessie would like to spell. The next four lines each contain a string with six
uppercase letters, representing the letters on the six sides of one of Bessie's
blocks. The next \(N\) lines contain the \(N\) words Bessie would like to spell.
Each of these is between 1 and 4 uppercase letters long.

출력 형식

For each word on Bessie's list, output YES if she is able to spell it using the
blocks and NO otherwise.

예제 1
입력
6
MOOOOO
OOOOOO
ABCDEF
UVWXYZ
COW
MOO
ZOO
MOVE
CODE
FARM
출력
YES
NO
YES
YES
NO
NO
설명

In this example, Bessie can spell COW, ZOO, and MOVE. Sadly, she cannot spell
MOO, since the only block with an M cannot also be used for an O. She cannot
spell FARM since there is no block with a letter R. She cannot spell CODE
since the C, D, and E all belong to the same block.

문제 정보

riseoj 작성

출처 올림피아드 > USACO > 2021-2022 > February > Bronze

태그

평가 및 의견

Blocks

개요
출제자 난이도 Bronze II 브론즈 II 의견 0 / 50 공개 집계 (커뮤니티 난이도, 주요 주제, 품질)는 의견이 충분히 모이면 공개됩니다.

Log in to rate problems.

개별 의견

아직 의견이 없습니다. 자격이 된다면 위 양식에서 가장 먼저 평가해 보세요.

풀이 제출

Blocks

게스트로 둘러보고 있습니다. 로그인하면 풀이를 제출하고 진행 상황을 확인할 수 있습니다. 로그인하고 제출하기
공개
C++20 Tab 들여쓰기 · Ctrl+/ 주석 토글 · Enter 자동 들여쓰기
1 1 1 0 공백: 4 · UTF-8