ACM邀请赛题目
跟着大牛们的脚步做次邀请赛
Joyyiwei
这个作者很懒,什么都没留下…
展开
-
FZU - 2039 Pets (二分图匹配 2011年全国大学生程序设计邀请赛(福州))
Description Are you interested in pets? There is a very famous pets shop in the center of the ACM city. There are totally m pets in the shop, numbered from 1 to m. One day, there are n customers in原创 2014-07-15 11:30:54 · 1593 阅读 · 0 评论 -
HDU - 4734 F(x) (2013成都网络赛,数位DP)
题意:求0-B的满足 思路:数位DP,记忆化搜索 #include #include #include #include using namespace std; int A, B; int dp[20][200000]; int bit[20]; int dfs(int cur, int num, int flag) { if (cur == -1) return num原创 2014-07-10 15:58:35 · 1402 阅读 · 0 评论 -
HDU 4856 Tunnels
题意:求经过所有的管道的最短路程,管道内的时间不算 思路:首先BFS处理出管道出口到其他管道入口的距离,然后在队友的指导下明白了状态转移 #include #include #include #include #include using namespace std; const int MAXN = 16; const int INF = 0x3f3f3f3f; struct N原创 2014-07-08 19:43:34 · 1230 阅读 · 0 评论 -
HDU - 4054 Hexadecimal View (2011 Asia Dalian Regional Contest)
题意:按要求输出,第一列是表示第几行,每行只能有16个字节的字母,第二列是16进制的ASCII码,第三列大小写转换 思路:纯模拟,注意字母的十六进制是2位 #include #include #include #include using namespace std; const int MAXN = 5000; char str[MAXN]; int main() { whil原创 2014-07-01 11:29:10 · 1512 阅读 · 0 评论 -
北京邀请赛 H. Happy Reversal
题意:给你一些二进制的数,然后你可以选择按位取反,也可以不变,你只能选择一种,然后让你找出最大和最小,求最大的差值 思路:将取反与不取反都算出来,然后大的放一边,小的放一边,排序后判断#include #include #include #include #define ll long long using namespace std; const int MAXN = 100010;原创 2014-05-30 10:59:24 · 1187 阅读 · 0 评论 -
北京邀请赛 B. Beautiful Garden
题意:给你坐标和n个点,求最少移动的点使得n个点成等差数列 思路:既然要成等差数列,那么最起码有两个点是不动的,然后枚举这两个点中间的点的个数,最近水的要死,看了队友的代码做的 #include #include #include #include #include #include using namespace std; const double eps = 1e-9; con原创 2014-05-30 15:03:46 · 1100 阅读 · 0 评论 -
HDU - 4813 Hard Code (长春赛区水题)
Description Some strange code is sent to Da Shan High School. It's said to be the prophet's note. The note is extremely hard to understand. However, Professor Meng is so smart that he successfully原创 2014-05-31 11:21:22 · 1899 阅读 · 0 评论 -
HDU - 4814 Golden Radio Base (长春赛区B题)
Description Golden ratio base (GRB) is a non-integer positional numeral system that uses the golden ratio (the irrational number (1+√5)/2 ≈ 1.61803399 symbolized by the Greek letter φ) as its base.原创 2014-05-31 20:54:26 · 1976 阅读 · 0 评论 -
HDU - 4815 Little Tiger vs. Deep Monkey (长春赛区C题)
题意:有A,B两个人,n道题目,每题有对应的分数,B答对题目的概率是0.5,求A不输给B的概率不小于P要拿的最低分数 思路:DP,dp[i][j]来表示B答了前i题后分数为j的概率,,然后通过B的概率求A的最低分数#include #include #include #include using namespace std; const int MAXN = 40010; int a[原创 2014-06-01 17:48:29 · 1167 阅读 · 0 评论 -
HDU - 4821 String (长春赛区I题)
题意:求有多少个子串满足条件: 1. 长度为M*L 2. 每个长度为L的小子串不能都完全相同的情况 思路:当时没做出来,HASH处理,看了个思路是: hash方法 设一个种子base 打表出nbase[i]表示base的i次方 从S最后一个字符开始打表 hash[i]=hash[i+1]*base+str[i]-'a'+1 即将i位以后的串hash成一个unsigned long原创 2014-06-03 19:27:22 · 1141 阅读 · 0 评论 -
HDU - 4788 Hard Disk Drive (成都邀请赛H 水题)
HDU - 4788 Hard Disk Drive Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u [Submit] [Go Back] [Status] Description Yesterday your dear cou原创 2014-06-04 14:49:38 · 1456 阅读 · 0 评论