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

32365번 - Heavy-Light Composition 서브태스크다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 1024 MB111938085.106%

문제

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.

제한

서브태스크

Subtask Score Bounds on T Bounds on N Other Restrictions
1 5 2 ≤ T ≤ 4 2 ≤ N ≤ 4 Only the letters “a” and “b” will be used
2 5 2 ≤ T ≤ 10 2 ≤ N ≤ 30 None
3 2 2 ≤ T ≤ 100 2 ≤ N ≤ 100 Only the letter “a” will be heavy; all other letters are light
4 3 2 ≤ T ≤ 10 000 2 ≤ N ≤ 100 None

예제 입력 1

3 4
abcb
bcbb
babc

예제 출력 1

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

예제 출력 2

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.

힌트

출처

Olympiad > Canadian Computing Competition & Olympiad > 2024 > CCC 2024 Senior Division 2번

채점 및 기타 정보

  • 예제는 채점하지 않는다.
(追記) (追記ここまで)

출처

대학교 대회

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

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