2013 Asia Chengdu Regional Contest】的更多相关文章

hdu 4786 Fibonacci Tree http://acm.hdu.edu.cn/showproblem.php?pid=4786 copyright@ts 算法源于ts,用最小生成树可以求出最小权值,把所有边权取反可以求出最大权值,算法是如果有个斐波那契数在最小到最大值之间,就一定能构成.也就是如果大了就把1边换成0边,反之亦然. #include<cstdio> #include<cstring> #include<algorithm> #define m…
Browsing History http://acm.hdu.edu.cn/showproblem.php?pid=4464 签到 #include<cstdio> #include<algorithm> using namespace std; ]; int main(){ ; while(~scanf("%d",&n)){ ; while(n--){ scanf("%s",a); ; ;a[i];i++){ sum+=a[i];…
Lights Against Dudely http://acm.hdu.edu.cn/showproblem.php?pid=4770 15个位置,所以可以暴力枚举那些放,对于放的再暴力枚举哪个转,对于转的,再枚举转哪个方向.选位置放我用了2进制枚举,选出哪个转和枚举4个方向for循环就行.可以加个小剪枝. #include<cstdio> #include<cstring> #include<algorithm> #define mt(a,b) memset(a,b…
Problem Description Conflicts are everywhere in the world, from the young to the elderly, from families to countries. Conflicts cause quarrels, fights or even wars. How wonderful the world will be if all conflicts can be eliminated.Edward contributes…
Description “Be subtle! Be subtle! And use your spies for every kind of business. ”― Sun Tzu“A spy with insufficient ability really sucks”― An anonymous general who lost the warYou, a general, following Sun Tzu’s instruction, make heavy use of spies…
Description P. T. Tigris is a student currently studying graph theory. One day, when he was studying hard, GS appeared around the corner shyly and came up with a problem: Given a graph with n nodes and m undirected weighted edges, every node having o…
http://acm.hdu.edu.cn/showproblem.php?pid=4771 题目大意: 给你一幅图(N*M)“@”是起点,"#"是墙,“.”是路,然后图上有K个珠宝, 问是否能全部取走珠宝,若能则输出最小步数,否则-1. 思路,可以bfs处理珠宝与珠宝,珠宝与起点的距离同时还可以判断是否可达, 最后因为K<=4,所以枚举路径输出最小ans #include <iostream> #include <cstdio> #include <…
参考:https://blog.csdn.net/sd_invol/article/details/15813671 要点 每个任务的结束时间是固定的,不受任何因素影响 机器只在最一开始有用,在那之后都是任务之间的转换 连边 将任务拆点,入点 i, 出点 i', 连边 (i, i' [1,1], 0) 设源点 s_, 汇点 t_ 对于机器 \(i (i \in [1, m])\), 连 (s_, i, 1, 0),即流量为1,费用为0 对每个任务 \(j\) 如果 \(C[i][j] \le s…
题目链接 http://acm.hdu.edu.cn/showproblem.php?pid=4800 Problem Description A role-playing game (RPG and sometimes roleplaying game) is a game in which players assume the roles of characters in a fictional setting. Players take responsibility for acting…
Conquer a New Region Time Limit: 5 Seconds      Memory Limit: 32768 KB The wheel of the history rolling forward, our king conquered a new region in a distant continent. There are N towns (numbered from 1 to N) in this region connected by several road…