Dragged-out Duel

면접 대비

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

요약
길이가 n인 두 가위바위보 문자열을 각 라운드마다 비교해, 나와 Guile 중 누가 더 많은 라운드를 이겼는지 판정한다.
난이도

쉬움10점 중 2점

유형
구현, 문자열, 시뮬레이션, 완전 탐색
정답자
아직 제출이 없습니다

문제

Your friend Guile and you have decided to spend an afternoon playing the new Street Fighter game, but you both want to start on the left, because you have both only practiced all your combos starting from the left. You decide to determine who starts on the left like true men -- with an intense grueling, and exhausting duel of rock-paper-scissors.

The duel will be a best-of-nn, consisting of nn single rounds of rock-paper-scissors (yes, you may have to play rock-paper-scissors ten thousand times, truly a war of attrition), and whoever wins more rounds, gets to start on the left. If you both pick the same option in an individual game, it is not replayed. To keep track of who wins, you decide to write a program, that determines whether you beat Guile in this great duel.

As a reminder: rock beats scissors, scissors beats paper, paper beats rock. If you both make the same choice, the round is a draw.

입력

The input consists of:

  • One line with a single integer nn (1≤n≤10,0001\leq n\leq 10\\,000), the number of individual games.
  • Two lines with nn characters, each character being either 'R' for rock, 'P' for paper, or 'S' for scissors. The first line represents your choices in each round, and the second line represents Guile's choices in each round.

출력

If you have won the most rounds of rock-paper-scissors, output "victory". If Guile has won the most rounds of rock-paper-scissors, output "defeat".

It is guaranteed that the both of you will not have the same number of wins.

예제2

  1. 예제 1

    입력
    5
    RRSSP
    SSSSS
    
    예상 출력
    victory
    
  2. 예제 2

    입력
    6
    PRSRPS
    PSSPPR
    
    예상 출력
    defeat