原创 Openjudge 佐助和鳴人(BFS+雙變量)

已知一張地圖(以二維矩陣的形式表示)以及佐助和鳴人的位置。地圖上的每個位置都可以走到,只不過有些位置上有大蛇丸的手下,需要先打敗大蛇丸的手下才能到這些位置。鳴人有一定數量的查克拉,每一個單位的查克拉可以打敗一個大蛇丸的手下。假設鳴人可以

原创 poj 3414 Pots(BFS+路徑)

POTS 總時間限制:  1000ms  內存限制:  65536kB 描述 You are given two pots, having the volume of A and B liters respectively. T

原创 刪除子串(DP+模擬)

鏈接:https://www.nowcoder.com/acm/contest/79/C來源:牛客網給你一個長度爲n且由a和b組成的字符串,你可以刪除其中任意的部分(可以不刪),使得刪除後的子串“變化”次數

原创 RMQ(Range Minimum/Maximum Query)

#include <cstdio> #include <iostream> #include <algorithm> #include <math.h> using namespace std; int maxsum[22][5000