上一页 1 2 3 4 5 6 7 8 ··· 21 下一页
摘要: 1 #include <iostream> 2 #include <cstdio> 3 #include <algorithm> 4 5 using namespace std; 6 7 #define ll long long 8 9 // a / b mod p 10 //满足条件 b 和 p互 阅读全文
posted @ 2020-08-02 23:30 SummerMingQAQ 阅读(137) 评论(0) 推荐(0) 编辑
摘要: 传送门 题意:给定一个n*m的地图,'.'空地,'#' 墙,'G'好人, 'B'坏人。问你存不存在一种方案,把若干空地变成'#'(人不能通过墙),使得所有好人能逃离地图,所有坏人不能逃离地图。(n,m)为出口,人存在的地方不能设置'#',保证出口一开始是空地。 思路: ① G == 0 Yes。 ② 阅读全文
posted @ 2020-07-31 16:43 SummerMingQAQ 阅读(263) 评论(0) 推荐(0) 编辑
摘要: 传送门 题目: Polycarp wrote on the board a string s containing only lowercase Latin letters ('a'-'z'). This string is known for you and given in the input. 阅读全文
posted @ 2020-07-28 23:56 SummerMingQAQ 阅读(188) 评论(0) 推荐(0) 编辑
摘要: 传送门 题目:给定一个串“codeforces”,给定一个n,让你在原串上任意位置添加任意个数的字符构造出一个字符串s,使得至少有n组子序列能够组成“codeforces”,需要构造出的串长度最短,再输出构造出的s 思路:根据排列组合的性质,我们尽量平均“codeforces”上每位的个数即可。 1 阅读全文
posted @ 2020-07-28 23:47 SummerMingQAQ 阅读(244) 评论(0) 推荐(0) 编辑
摘要: 传送门 题目: ①所有块之间能够相互到达,即使一个连通图 ②所有块有偶数个邻居 ③规定有n个块有4个邻居 每组测试给定一个n,问你怎么构造一个图。 思路:水题。我们先构造好一个边长为2的矩形,然后我们给该矩形右下角添加三个块就能表达一个“有四个邻居”的块。 1 #include <iostream> 阅读全文
posted @ 2020-07-28 23:38 SummerMingQAQ 阅读(169) 评论(0) 推荐(0) 编辑
摘要: 传送门 题目:给定两个字符串A,B。我们可以改变A中任意数量相同的字符x变成字符y(必须满足y > x),我们能否把A变成B,可以的话最少几次,不可以输出‘-1’。 思路:看了所有样例后,再通过样例1可以想到一个方法。我们有一个矩阵app['a'~'t']['a'~'t']记录A与B的对应关系,例如 阅读全文
posted @ 2020-07-27 00:42 SummerMingQAQ 阅读(434) 评论(0) 推荐(0) 编辑
摘要: 传送门 题目: Gottfried learned about binary number representation. He then came up with this task and presented it to you. You are given a collection of nn 阅读全文
posted @ 2020-07-26 16:31 SummerMingQAQ 阅读(247) 评论(0) 推荐(0) 编辑
摘要: 题目: A mad scientist Dr.Jubal has made a competitive programming task. Try to solve it! You are given integers n,k. Construct a grid AA with size n×n c 阅读全文
posted @ 2020-07-24 20:36 SummerMingQAQ 阅读(153) 评论(0) 推荐(0) 编辑
摘要: 题目: Patrick likes to play baseball, but sometimes he will spend so many hours hitting home runs that his mind starts to get foggy! Patrick is sure tha 阅读全文
posted @ 2020-07-24 20:30 SummerMingQAQ 阅读(204) 评论(0) 推荐(0) 编辑
摘要: 题目: Let a and b be two arrays of lengths n and m, respectively, with no elements in common. We can define a new array merge(a,b) of length n+m recursi 阅读全文
posted @ 2020-07-24 20:21 SummerMingQAQ 阅读(246) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 ··· 21 下一页