問題一覧 > ネタ問題

No.8081 HQ9+

レベル : / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 53
作問者 : kotatsugame / テスター : %20
お気に入りにしたユーザー ProblemId : 6056 / 自分の提出
問題文最終更新日: 2021-03-10 19:00:50
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 2021 (順位表) の他の問題:

Problem Statement

You are given a string $S$ of length $N$. Each character of $S$ is an uppercase or lowercase letter. Create and output a single-line HQ9+ source code that outputs the string $S$.

If no such source code exists, output -1 instead.

*For HQ9+, read this page or check the implementations in C++ or Python3 below.

Note that the C++ code or the Python3 code at the links below is considered to be the HQ9+ implementation used. It is guaranteed that an answer to this problem, if one exists, behaves identically under either implementation.

HQ9p.cpp HQ9p.py

Importantly, in the implementations used here, HQ9+ source code is recognized only up to just before the first newline. For code spanning two or more lines, only the part up to just before the newline of the first line is read, and the string output by the Q command also consists of only that part.

Therefore, if there exists an HQ9+ source code that outputs the string $S$ when run with these implementations, then a single-line one always exists as well.

Input

$N$
$S$

$1 \le N \le 10^5$

$N$ is an integer.

$|S|=N$

Each character of $S$ is an uppercase or lowercase letter.

Output

Output, on a single line, an HQ9+ source code that outputs the string $S$ when run with the implementation specified in the problem statement, followed by a newline.

Sample

Sample 1
Input
1
Q
Output
Q

The Q command outputs the source code itself. This is "Q", which matches the input string.

Sample 2
Input
3
abc
Output
-1

It can be shown that no HQ9+ source code outputs only the string "abc".

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