RelocationTime Limit:1000MSMemory Limit:65536KTotal Submissions:2631Accepted:1075DescriptionEmma and Eric are moving to their new house they bought af...
分类:
其他好文 时间:
2015-07-17 22:25:03
阅读次数:
119
又一道状压dp查了半天错 又被位运算的优先级坑了 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #define b(a) (1>1;37 }38 return 1;39 }...
分类:
其他好文 时间:
2015-07-17 18:00:59
阅读次数:
113
题目链接:点击打开链接
题目大意:有n个点,m条有向边,经过边需要一个花费,a b c p q代表 a到b的一条道路,如果经过这条边之前经过c点,那么需要p的花费,否则需要q的花费,问从1点到n点的最小花费。
方法1、每条边可能会经过多次,每个点也可以经过多次,这样就没有了边界不能直接进行dfs,因为要记录之前经过的边,所以使用状压,dis[i][j]:当前在第i个点,j表示经过了的点,这样就...
分类:
其他好文 时间:
2015-07-17 16:10:48
阅读次数:
80
//这题的数据是不是有问题... 不考虑宝藏一个也拿不到也能AC... 1 #include "bits/stdc++.h" 2 using namespace std; 3 const int INF = 0x3f3f3f3f; 4 int T; 5 int N, M; 6 int m...
分类:
其他好文 时间:
2015-07-17 15:29:09
阅读次数:
174
1 #include "bits/stdc++.h" 2 using namespace std; 3 int T; 4 5 int dp[40000]; 6 int totene[40000]; 7 8 int N, E; 9 int val[20], ene[20], cond[20];1...
分类:
其他好文 时间:
2015-07-16 19:33:01
阅读次数:
96
//2015.7.16 首A 1 #include "bits/stdc++.h" 2 using namespace std; 3 int T; 4 int N; 5 char subject[20][110]; 6 int deadline[20], spend[20]; 7 int dp[40...
分类:
其他好文 时间:
2015-07-16 16:21:09
阅读次数:
97
题目链接
题意:
给定n个长度均为m的字符串
下面n行给出字符串
下面n*m的矩阵表示把对应的字母修改成其他字母的花费。
问:
对于一个字符串,若它是easy to remembering 当 它存在一个字母,使得这个字母在这一列是独一无二的。
要使得n个字符串都是easy to remembering 的最小花费。
第一个样例是把第一列的4个a中3个a修改成别的字母,所以花费为3...
分类:
其他好文 时间:
2015-07-15 22:49:06
阅读次数:
159
题目:http://www.lydsy.com/JudgeOnline/problem.php?id=1151状压DP,枚举前面4个,使得环型变线型。#include#include#include#include#include#include#include#include#include#in...
分类:
其他好文 时间:
2015-07-15 22:31:48
阅读次数:
189
Problem Description
“Swipe Bo” is a puzzle game that requires foresight and skill.
The main character of this game is a square blue tofu called Bo. We can swipe up / down / left / right to move B...
分类:
其他好文 时间:
2015-07-14 13:36:00
阅读次数:
123
简单的状压dp...dp( x , h , s ) 表示当前第 x 行 , 用了 h 个 king , 当前行的状态为 s .考虑转移 : dp( x , h , s ) = ∑ dp( x - 1 , h - cnt_1( s ) , s' ) ( s and s' 两行不冲突 , cnt_1( ...
分类:
其他好文 时间:
2015-07-13 23:53:03
阅读次数:
146