問題一覧 > ネタ問題

No.8041 Flower Fortune-Telling of Something

レベル : / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 226
作問者 : iwkjosec
お気に入りにしたユーザー ProblemId : 2918 / 自分の提出
問題文最終更新日: 2022-07-05 12:37:05
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Back to the original
yukicoder April Fool Contest 2019 (順位表) の他の問題:

Problem Statement

There is $1$ flower with $N$ petals. Kanna and Miyata use this flower to play a game similar to flower fortune-telling.
Kanna moves first, and the two players take turns pulling $1\sim3$ petals from the flower.
After the first petal, that is, $1$ petal, is pulled, the state is "like"; after the $2$nd petal is pulled, it is "dislike"; after the $3$rd petal is pulled, it is "like";
and so on. In this way, each time $1$ petal is pulled, the state alternates between "like" and "dislike", starting from "like".
The outcome is decided as follows: if the state is "like" after the last petal is pulled, the player who pulled last wins; if it is "dislike", the player who pulled last loses.

Given the number of petals $N$ at the start of the game, print Yes if Kanna, who moves first, can win when both players play optimally, and print No otherwise.

Input

$N$

  • $1 \le N \le 1000$
  • $N$ is an integer.
  • Output

    Yes or No
    Print a newline at the end.

    Sample

    Sample 1
    Input
    7
    Output
    Yes

    If Kanna pulls $3$ petals on the first move, the state goes $\to$ "like" $\to$ "dislike" $\to$ "like", and $4$ petals remain.
    Then, no matter how Miyata pulls from the remaining $4$ petals, Kanna can pull all the remaining petals next, so the state goes $\to$ "dislike" $\to$ "like" $\to$ "dislike" $\to$ "like",
    and Kanna can win.

    Sample 2
    Input
    724
    Output
    Yes

    提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。