原创 FZU 2124 喫豆人(BFS)

Description 喫豆人是一款非常經典的遊戲,遊戲中玩家控制喫豆人在地圖上喫光所有豆子,並且避免被怪物抓住。 這道題沒有怪物,將遊戲的畫面分成n*m的格子,每格地形可能爲空地或者障礙物,喫豆人可以在空地上移動,喫豆人每移動一格需

原创 SWUST ACM 訓練題部分題解 hdu1384 && hdu3666 && hdu 4786 &&uva 1395 && uva 1151

訓練題網址:http://acm.hust.edu.cn/vjudge/contest/view.action?cid=99765#problem/A 密碼:acm2015 B - Intervals (hdu1384) 題意:給你n個區

原创 poj 1734 Sightseeing trip (floyd求最小環並記錄路徑)

點擊打開題目鏈接 Description There is a travel agency in Adelton town on Zanzibar island. It has decided to offer its clients,

原创 POJ 1475 Pushing Boxes(BFS)

Description Imagine you are standing inside a two-dimensional maze composed of square cells which may or may not be f

原创 HDU 3667 Transportation (最小費用最大流)

Description There are N cities, and M directed roads connecting them. Now you want to transport K units of goods from

原创 POJ 1637 Sightseeing tour (網絡流解決混合圖歐拉回路問題)

Description The city executive board in Lund wants to construct a sightseeing tour by bus in Lund, so that tourists c

原创 有向圖強連通分量Tarjan模板

#include<stdio.h> #include<string.h> #include<algorithm> using namespace std; const int maxn=10010; const int maxm=1000

原创 POJ 2391 Ombrophobic Bovines (網絡流)

Description FJ's cows really hate getting wet so much that the mere thought of getting caught in the rain makes them

原创 線性規劃與網絡流24題 太空飛行計劃問題 (最小割及輸出方案)

太空飛行計劃問題 題目描述 W 教授正在爲國家航天中心計劃一系列的太空飛行。每次太空飛行可進行一系列商業性實驗而獲取利潤。現已確定了一個可供選擇的實驗集合E={E1,E2,…,Em},和進行這些實驗需要使用的全部儀器的集合I={I1,I2

原创 CodeForces - 620E New Year Tree (線段樹+dfs序)

E. New Year Tree time limit per test 3 seconds memory limit per test 256 megabytes input standard input output standard

原创 ZOJ 2760 How Many Shortest Path (最小費用最大流做法)

Description Given a weighted directed graph, we define the shortest path as the path who has the smallest length amon

原创 hdu 5619 Jam's store (費用流)

問題描述 Jam不好好學習,然後就去幫別人修電腦了,在一家店裏,有M個店員,現在有N個顧客,給出每個顧客對應給每個店員的修電腦的時間爲Tij,問所有顧客要等待的最少時間。當然,一個顧客在某個店員那裏完成之後,那個店員纔會執行下一個顧客的任

原创 POJ 3281 Dining (網絡流)

Description Cows are such finicky eaters. Each cow has a preference for certain foods and drinks, and she will consu

原创 POJ 3422 Kaka's Matrix Travels (最大費用最大流)

  Description On an N ×N chessboard with a non-negative number in each grid, Kaka starts his matrix travels withSUM

原创 SGU 326 Perspective (網絡流)

Description Breaking news! A Russian billionaire has bought a yet undisclosed NBA team. He's planning to invest huge