随笔分类 - 还得重做
摘要:题意:原题在这 给出一个配对的括号序列(如"(())()"、"()"等, ")()"、"(()"是不符合要求的 ),对该序列按以下方法进行染色: 1.一个括号可以染红色、蓝色或不染色 2.一对匹配的括号需要且只能将其中一个染色 3.相邻两个括号颜色不能相同(但可以都不染色) 求符合条件的染色方案数(
阅读全文
摘要:题意:原题在这 You've got a string s = s1s2... s|s| of length |s|, consisting of lowercase English letters. There also are q queries, each query is described
阅读全文
摘要:题意:原题在这 Alexander is learning how to convert numbers from the decimal system to any other, however, he doesn't know English letters, so he writes any
阅读全文
摘要:题意:原题在这 Wilbur the pig really wants to be a beaver, so he decided today to pretend he is a beaver and bite at trees to cut them down. There are nn tre
阅读全文
摘要:题意:原题在这 快递小哥从city 0出发去(n+1)*(n+1)城市矩阵中送快递,求来回最短时间 做法: TSP问题,这里选用dp做法 Floyd初始化城市间的距离; 令dp[1<<i][i]=dis[0][i]; 表示先走一格,好转移 dp[s][j]表示走了j个城市,状态为s时的最小时间 注意
阅读全文
摘要:题意:原题在这 Squares and rectangles fascinated the famous Dutch painter Piet Mondriaan. One night, after producing the drawings in his 'toilet series' (whe
阅读全文
摘要:题意:原题在这 司令部的将军们打算在N*M的网格地图上部署他们的炮兵部队。一个N*M的地图由N行M列组成,地图的每一格可能是山地(用“H” 表示),也可能是平原(用“P”表示),如下图。在每一格平原地形上最多可以布置一支炮兵部队(山地上不能够部署炮兵部队);一支炮兵部队在地图上的攻击范围如图中黑色区
阅读全文

浙公网安备 33010602011771号