AlgoLensArena
ContestlərProblemlərOtaqlar
Vizualizator
← Məsələlər

FPC24-014.Dragged-out Duel

Easy · 1 s · 256 MB

  • icpc
  • fpc
  • 2024

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-nnn, consisting of nnn 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.

Giriş formatı

The input consists of:

• One line with a single integer nnn (1≤n≤10 0001\leq n\leq 10\,0001≤n≤10000), the number of individual games.

• Two lines with nnn 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.

Çıxış formatı

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.

Qeyd

Source: Freshmen Programming Contest 2024 · Author: Wietze Koops · License: CC BY-SA 4.0 · Original: https://fpc.wisv.ch · Statement adapted for AlgoLens and shared under the same license.

Nümunələr

Giriş #1

5
RRSSP
SSSSS

Çıxış #1

victory

Giriş #2

6
PRSRPS
PSSPPR

Çıxış #2

defeat