Rock, Paper, Scissors

시간 제한1초메모리 제한2048 MB

요약
상대의 패턴을 추론해 20라운드로 진행되는 가위바위보 세 판 중 최소 두 판을 이겨야 한다.
난이도

어려움10점 중 8점

유형
게임 이론, 문자열 매칭, 구현
정답자
아직 제출이 없습니다

문제

This is an interactive run-thrice problem.

Your task is to develop a strategy that guarantees you win at Rock, Paper, Scissors every time. Yes, you heard that right --- and there's no trickery involved!

Now, let me quickly recap the rules for those who might not be familiar. In this game, two players each select one of three symbols: rock, paper, or scissors. The hierarchy is simple: rock crushes scissors, paper covers rock, and scissors cut paper. If both players choose the same symbol, the round results in a draw.

In this contest, you will face off in three separate games, with each game consisting of 2020 rounds. To emerge victorious in a game, you must win more rounds than you lose. Your ultimate goal is to win at least two out of the three games.

Are you ready to take on the challenge? Good luck!

...And don't forget to check out the next section; it'll give you insight into your opponent.

힌트

The examples illustrate the first five moves only instead of twenty moves.

예제3

  1. 예제 1

    입력
    
    D
    
    L
    
    W
    
    D
    
    L
    
    예상 출력
    R
    
    R
    
    R
    
    R
    
    R
    
    
  2. 예제 2

    입력
    
    W
    
    W
    
    W
    
    W
    
    W
    
    예상 출력
    S
    
    S
    
    S
    
    S
    
    S
    
    
  3. 예제 3

    입력
    
    W
    
    W
    
    W
    
    W
    
    W
    
    예상 출력
    P
    
    P
    
    P
    
    P
    
    P