C++
文章平均质量分 79
小编程员
想学好编程的小菜鸡
展开
-
NOJ 木乃伊迷宫代码和思路
这道题是分支限界的方法,工具是BFS(广度优先遍历),下面列举了我觉得有问题的几个点(如果有补充或者还有其他问题,请私信,或者评论):1.墙的问题:这道题每个格子只有右边和下边有墙,但是注意一点,如果一个格子的左边的格子有了墙,那么这个格子也就相当于左边有了墙,所以在读入墙的时候,我们要注意一点:一个格子的左边有墙,那么它右边的格子的左边也就要加上一堵墙,但是这个加墙的前提是右边有墙的格子不是最右边的格子,加在格子下面的墙是同理的2.这里的走步数的话,设置一个二维数组来保存人走的方向,木乃伊的话一定要在原创 2021-10-17 21:07:17 · 407 阅读 · 0 评论 -
HDU-6237 A Simple Stone Game(思维+贪心)
题目链接Problem DescriptionAfter he has learned how to play Nim game, Bob begins to try another stone game which seems much easier.The game goes like this: one player starts the game with N piles of stones. There is ai stones on the ith pile. On one turn, t原创 2021-07-24 18:34:44 · 162 阅读 · 0 评论 -
Stone Game
题目链接题目描述Alice and Bob are always playing game! The game today is about taking out stone from the stone piles in turn.There are n piles of stones, and the i-th pile contains A[i] stones.As the number of stones in each pile differs from its neighbor’s, t原创 2021-07-23 16:57:26 · 249 阅读 · 0 评论 -
2018CCPC桂林站题解——H. Hamming Distance
题目链接题目描述In information theory, the Hamming distance between two strings of equal length is the number of positions at which the corresponding symbols are different. In other words, it measures the minimum number of substitutions required to change one st原创 2021-07-23 00:50:37 · 529 阅读 · 0 评论 -
D. Bits Reverse 2018CCPC桂林站
题目链接题目描述Now given two integers x and y, you can reverse every consecutive three bits in arbitrary number’s binary form (any leading zero can be taken into account) using one coin. Reversing (1,2,3) means changing it into (3,2,1).Could you please find a原创 2021-07-22 18:12:12 · 130 阅读 · 0 评论