CF1554D.Diane
普及+/提高
通过率:0%
时间限制:1.00s
内存限制:256MB
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
You are given an integer n. Find any string s of length n consisting only of English lowercase letters such that each non-empty substring of s occurs in s 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 a is a substring of a string b if a can be obtained from b by deletion of several (possibly, zero or all) characters from the beginning and several (possibly, zero or all) characters from the end.
给你一个整数 n。请构造任意一个长度为 n 的字符串 s,其仅由小写英文字母组成,使得 s 的每个非空子串在 s 中出现的次数均为奇数。如果存在多个满足条件的字符串,输出任意一个即可。可以证明:在给定约束下,这样的字符串一定存在。
若字符串 a 可通过从字符串 b 的开头删除若干(可能为零或全部)字符、并从结尾删除若干(可能为零或全部)字符而得到,则称 a 是 b 的一个子串。
输入格式
The first line contains a single integer t (1≤t≤500) — the number of test cases.
The first line of each test case contains a single integer n (1≤n≤105).
It is guaranteed that the sum of n over all test cases doesn't exceed 3⋅105.
第一行包含一个整数 t(1≤t≤500)——测试用例的数量。
每个测试用例的第一行包含一个整数 n(1≤n≤105)。
保证所有测试用例的 n 之和不超过 3⋅105。
输出格式
For each test case, print a single line containing the string s. If there are multiple such strings, output any. It can be shown that such string always exists under the given constraints.
对于每个测试用例,输出一行,包含字符串 s。如果存在多个满足条件的字符串,则输出任意一个即可。在给定约束条件下,可以证明这样的字符串总是存在的。
输入输出样例
输入#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 5 times, "a" and "bb" occur 3 times each, and each of the remaining substrings occurs exactly once.
在第一个测试用例中,字符串 "abc" 的每个子串均恰好出现一次。
在第三个测试用例中,字符串 "bbcaabbba" 的每个子串均出现奇数次。具体而言,"b" 出现了 5 次,"a" 和 "bb" 各出现了 3 次,其余每个子串均恰好出现一次。
输入解题思路,AI测评打分。不知道怎么写?