摘要: 构造字符串 给定一个整数 n,请你构造一个长度为 n 的字符串,要求: 字符串中不含 a,b,c 以外的字符。 字符串中不含长度为 3 的回文子串。 字符串中 c 的数量尽可能少(最好没有)。 输入格式 一个整数 n。 输出格式 一个满足条件的字符串。 如果答案不唯一,则输出任意合理方案均可。 数据 阅读全文
posted @ 2023-03-08 22:18 Keith- 阅读(29) 评论(0) 推荐(0) 编辑
摘要: 字符串查询 给你单词 S 和 Q 个询问。 每次询问,你会得到正整数 A,B,C 和 D。 我们令单词 X 由 S 的第 A 到 B 个字母组成,单词 Y 由 S 的第 C 到 D 个字母组成。 你需要回答,是否能够重新排列单词 Y 中的字母,得到单词 X。 输入格式 第一行一个单词 S,仅由小写字 阅读全文
posted @ 2023-03-08 21:29 Keith- 阅读(51) 评论(0) 推荐(0) 编辑
摘要: F. Find / -type f -or -type d 原题链接 题意 找到".eoj"结尾的"文件"(注意是".eoj"不是"eoj") 思路 One more thing, on your file system, directory is only a logical concept. T 阅读全文
posted @ 2023-03-08 20:49 Keith- 阅读(28) 评论(0) 推荐(0) 编辑
摘要: I. Idiotic Suffix Array 原题链接 题意 构造出一个长度为n只由小写字母组成且首位字符的后缀串在字典序中排第k的字符串 baaa...aa(k-1)cc...ccc(n-k) 代码 点击查看代码 #include<iostream> #include<cstdio> #incl 阅读全文
posted @ 2023-03-08 11:39 Keith- 阅读(18) 评论(0) 推荐(0) 编辑
摘要: A. Amateur Chess Players 原题链接 题意 At the beginning, Cuber QQ, who has the white pieces, and Quber CC, who has the black pieces, place some of their pie 阅读全文
posted @ 2023-03-08 11:14 Keith- 阅读(14) 评论(0) 推荐(0) 编辑