CF1554D.Diane

普及+/提高

通过率:0%

时间限制:1.00s

内存限制:256MB

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

You are given an integer nn. Find any string ss of length nn consisting only of English lowercase letters such that each non-empty substring of ss occurs in ss an odd number of times. If there are multiple such strings, output any. It can be shown that such string always exists under the given constraints.

A string aa is a substring of a string bb if aa can be obtained from bb by deletion of several (possibly, zero or all) characters from the beginning and several (possibly, zero or all) characters from the end.

给你一个整数 nn。请构造任意一个长度为 nn 的字符串 ss,其仅由小写英文字母组成,使得 ss 的每个非空子串在 ss 中出现的次数均为奇数。如果存在多个满足条件的字符串,输出任意一个即可。可以证明:在给定约束下,这样的字符串一定存在。

若字符串 aa 可通过从字符串 bb 的开头删除若干(可能为零或全部)字符、并从结尾删除若干(可能为零或全部)字符而得到,则称 aa 是 bb 的一个子串。

输入格式

The first line contains a single integer tt (1≤t≤5001 \le t \le 500) — the number of test cases.

The first line of each test case contains a single integer nn (1≤n≤1051 \le n \le 10^5).

It is guaranteed that the sum of nn over all test cases doesn't exceed 3⋅1053 \cdot 10^5.

第一行包含一个整数 tt(1≤t≤5001 \le t \le 500)——测试用例的数量。

每个测试用例的第一行包含一个整数 nn(1≤n≤1051 \le n \le 10^5)。

保证所有测试用例的 nn 之和不超过 3⋅1053 \cdot 10^5。

输出格式

For each test case, print a single line containing the string ss. If there are multiple such strings, output any. It can be shown that such string always exists under the given constraints.

对于每个测试用例,输出一行,包含字符串 ss。如果存在多个满足条件的字符串,则输出任意一个即可。在给定约束条件下,可以证明这样的字符串总是存在的。

输入输出样例

  • 输入#1

    4
    3
    5
    9
    19

    输出#1

    abc
    diane
    bbcaabbba
    youarethecutestuwuu

说明/提示

In the first test case, each substring of "abc" occurs exactly once.

In the third test case, each substring of "bbcaabbba" occurs an odd number of times. In particular, "b" occurs 55 times, "a" and "bb" occur 33 times each, and each of the remaining substrings occurs exactly once.

在第一个测试用例中,字符串 "abc" 的每个子串均恰好出现一次。

在第三个测试用例中,字符串 "bbcaabbba" 的每个子串均出现奇数次。具体而言,"b" 出现了 55 次,"a" 和 "bb" 各出现了 33 次,其余每个子串均恰好出现一次。

输入解题思路,AI测评打分。不知道怎么写?

首页