問題一覧 > 通常問題

No.254 Constructing a String

レベル : / AI推定難易度 : 1400 / 実行時間制限 : 1ケース 5.000秒 / メモリ制限 : 512 MB / スペシャルジャッジ問題 (複数の解が存在する可能性があります)
タグ : (AC するまで非表示) / 解いたユーザー数 105
作問者 : sugim48
お気に入りにしたユーザー ProblemId : 676 / 自分の提出
問題文最終更新日: 2026-06-25 12:09:23
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 1周年記念 復習コンテスト R1 (順位表) の他の問題:

Problem Statement

You are given a positive integer $N$. Find $1$ string $S$ that satisfies all of the following conditions.

  • $1\le|S|\le10^5$
  • It consists of lowercase English letters only.
  • Any two adjacent characters are different.
  • Palindromic substrings occur at exactly $N$ positions.
  • Input

    N
    

    $1\le N\le10^9$

    Output

    Print $1$ string $S$ that satisfies all of the conditions. If no such $S$ exists, print your favorite sushi topping instead.

    Sample

    Sample 1
    Input
    1
    
    Output
    a
    

    Other answers such as "b" and "z" are also accepted.

    Sample 2
    Input
    4
    
    Output
    iwi
    

    Palindromic substrings occur at $4$ positions: "i", "w", "i", and "iwi".

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