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

S2. Heavy-Light Composition

Unrated 레이팅 미적용
난이도
2s
시간 제한
256MB
메모리 제한
0
맞았습니다!!
0
제출 수
0.0%
정답률
레이팅

의견: 0

설명

In a string containing only lowercase letters of the alphabet ("a"
through "z"), we say a letter is heavy if it appears more than
once in the string, and light otherwise.

We will be given a number of strings. For each string, we would like
to determine whether the letters of the string alternate between light
and heavy.

제약
입력 형식

The first line of input will consist of two positive integers \(T\) and \(N\), representing the number of strings and
the length of each string.

The next \(T\) lines each contain a
sequence of \(N\) lowercase letters of
the alphabet.

출력 형식

Output \(T\) lines, where each line
will be either T or F. If the \(i\)-th input string does alternate between
light and heavy letters, the \(i\)-th
line of output should be T; and otherwise, the \(i\)-th line of output should be
F.

서브태스크
서브태스크점수설명

1

34점

\(2 \le T \le 4\)\(2 \le N \le 4\) — Only the letters "a" and "b" will be used

2

33점

\(2 \le T \le 10\)\(2 \le N \le 30\) — None

3

13점

\(2 \le T \le 100\)\(2 \le N \le 100\) — Only the letter "a" will be heavy; all other letters are light

4

20점

\(2 \le T \le 10\ 000\)\(2 \le N \le 100~~\) — None

예제 1
입력
3 4
abcb
bcbb
babc
출력
T
F
T
설명

The first string is composed of a light letter, then a heavy letter,
then a light letter, and then a heavy letter.

The second string ends in two consecutive heavy letters.

The third string is composed of a heavy letter, then a light letter,
then a heavy letter, and then a light letter.

예제 2
입력
2 3
abc
bcb
출력
F
T
설명

The first string is composed of all light letters.

The second string is composed of a heavy letter, then a light letter,
and then a heavy letter.

문제 정보

생성자가 기록되지 않았습니다.

출처 CCC 2024 Senior

평가 및 의견

S2. Heavy-Light Composition

개요
출제자 난이도 Unrated 레이팅 미적용 의견 0 / 50 공개 집계 (커뮤니티 난이도, 주요 주제, 품질)는 의견이 충분히 모이면 공개됩니다.

Log in to rate problems.

개별 의견

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

풀이 제출

S2. Heavy-Light Composition

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