FZU 2150 Fire Game(BFS)
传送门:Fire Game
人一我百!人十我万!永不放弃~~~怀着自信的心,去追逐梦想 ——kuangbin
Problem
Description
Fat brother and Maze are playing a kind of special (hentai) game on an N*M board (N rows, M columns). At the beginning, each grid of this board is consisting of grass or just empty and then they start to fire all the grass. Firstly they choose two grids which are consisting of grass and set fire. As we all know, the fire can spread among the grass. If the grid (x, y) is firing at time t, the grid which is adjacent to this grid will fire at time t+1 which refers to the grid (x+1, y), (x-1, y), (x, y+1), (x, y-1). This process ends when no new grid get fire. If then all the grid which are consisting of grass is get fired, Fat brother and Maze will stand in the middle of the grid and playing a MORE special (hentai) game. (Maybe it’s the OOXX game which decrypted in the last problem, who knows.)
POJ 3414 Pots (BFS + 记录路径)
传送门:Pots
人一我百!人十我万!永不放弃~~~怀着自信的心,去追逐梦想 ——kuangbin
Problem
Description
You are given two pots, having the volume of A and B liters respectively. The following operations can be performed:
- FILL(i) fill the pot i (1 ≤ i ≤ 2) from the tap;
- DROP(i) empty the pot i to the drain;
- POUR(i,j) pour from pot i to pot j; after this operation either the pot j is full (and there may be some water left in the pot i), or the pot i is empty (and all its contents have been moved to the pot j).
Write a program to find the shortest possible sequence of these operations that will yield exactly C liters of water in one of the pots.
POJ 3087 Shuffle'm Up (模拟)
人一我百!人十我万!永不放弃~~~怀着自信的心,去追逐梦想 ——kuangbin
看了一眼,水题, 不想写了, 感觉提高不大。
POJ 3126 Prime Path (素数表 + BFS)
传送门:Prime Path
人一我百!人十我万!永不放弃~~~怀着自信的心,去追逐梦想 ——kuangbin
Problem
Description
The ministers of the cabinet were quite upset by the message from the Chief of Security stating that they would all have to change the four-digit room numbers on their offices.
POJ 1426 Find The Multiple(BFS)
人一我百!人十我万!永不放弃~~~怀着自信的心,去追逐梦想 ——kuangbin
Problem
Description
Given a positive integer n, write a program to find out a nonzero multiple m of n whose decimal representation contains only the digits 0 and 1. You may assume that n is not greater than 200 and there is a corresponding m containing no more than 100 decimal digits.
POJ 3279 Fliptile (爆搜 + 一点点状压的知识)
传送门:Fliptile
人一我百!人十我万!永不放弃~~~怀着自信的心,去追逐梦想 ——kuangbin
Problem
Description
Farmer John knows that an intellectually satisfied cow is a happy cow who will give more milk. He has arranged a brainy activity for cows in which they manipulate an M × N grid (1 ≤ M ≤ 15; 1 ≤ N ≤ 15) of square tiles, each of which is colored black on one side and white on the other side.
POJ 3278 Catch That Cow (BFS + 剪枝)
人一我百!人十我万!永不放弃~~~怀着自信的心,去追逐梦想 ——kuangbin
Problem
Description
Farmer John has been informed of the location of a fugitive cow and wants to catch her immediately. He starts at a point N (0 ≤ N ≤ 100,000) on a number line and the cow is at a point K (0 ≤ K ≤ 100,000) on the same number line. Farmer John has two modes of transportation: walking and teleporting.
lower_bound () 和 upper_bound () 在从大到小数组中的使用
今天突发奇想,想知道 lower_bound()
和 upper_bound()
函数在从大到小的数组中怎么使用,猜想 C++ 中应该会有重载, 果不其然, 正确打开姿势是酱紫。
1 | lower_bound(begin, end, val, greater<T>()) |
发现了一个好玩的东东
发现了一个好玩的东东