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

23654번 - Fizz and Buzz 스페셜 저지다국어

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

문제

Two dwarves, Fizz and Buzz, compose a sequence of $n$ integers. Each element is constructed as follows. First, the friends toss a fair coin to choose who will create the next number: with probability $\frac{1}{2}$ it will be Fizz, and with probability $\frac{1}{2}$ it will be Buzz. After that, if the toss was in favor of Fizz, he considers all integers from 1ドル$ to 10ドル,000円$ divisible by 3ドル$ and selects one of them at random. All these integers have the same probability of being selected. If the toss was in favor of Buzz, he considers all integers from 1ドル$ to 10ドル,000円$ divisible by 5ドル$ and selects one of them at random. All these integers also have the same probability of being selected. All coin tosses and all integer selections are independent events.

The dwarves composed a sequence of $n$ integers by the rules outlined above. Given the resulting sequence, guess who created which number, and do not make too many errors in the process.

입력

The first line contains an integer $n,ドル the length of the sequence (1ドル \le n \le 10,000円$). The second line contains the sequence itself: the integers $a_1,ドル $a_2,ドル $\ldots,ドル $a_n$ (1ドル \le a_i \le 10,000円$). It is guaranteed that the sequence was composed according to the problem statement using a random number generator.

출력

Print a single line with $n$ characters each of which is either "F" or "B". In the perfect answer, the character at position $i$ must be "F" if the number $a_i$ was created by Fizz, or "B" if the number $a_i$ was created by Buzz. Your answer can contain at most 1200ドル$ errors. In other words, it can differ from the perfect answer at no more than 1200ドル$ positions.

제한

예제 입력 1

10
3216 7770 8448 3438 6255 330 405 5835 6140 7475

예제 출력 1

FBFFBBFBBB

노트

The example above shows the perfect answer. In this example, the solution can not make more than ten errors, so any correctly formatted answer will be accepted.

출처

Contest > Open Cup > 2018/2019 Season > Stage 9: Grand Prix of Peterhof F번

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

출처

대학교 대회

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

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