随笔分类 - OJ_HDU
摘要:不容易系列之一 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 20941 Accepted Submission(s): 8937 Proble
阅读全文
摘要:e.g. HDU1002 简单加法 HDU1715 大斐波那契数 HDU1865 分析(转): 简单递推+大数。 f[n]=f[n-1]+f[n-2]。 why? 由于数字只有'1'和'2'这两种,那么当让第n 位为1的时候,f[n]加上f[n-1];当让最后两位 合并成2的时候,f[n]加上f[n
阅读全文
摘要:分析: n行 每行包含两个整数p r;意思是p从到r 不能有交叉的路 p刚好从1->n, 可看做下标,到的地方看做值 就转化为了最长上升子序列的问题 此题难点,怎么将其转化为LIS问题
阅读全文
摘要:分析: 给一个序列,求出每个位置结尾的最长上升子序列 O(n^2) 超时 优化为O(nlogn) AC 若只要最长...,只输出ans[n-1] 可将上述解法当做一模板 #include <iostream> #include <stdio.h> #include <algorithm> #incl
阅读全文
摘要:畅通工程 Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 27972 Accepted Submission(s): 12279 Problem
阅读全文
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=1596 分析: 题目要找一条安全度最高的路,安全度计算方法 Safe(P) = s(e1)*s(e2)…*s(ek) e1,e2,ek是P 上的边 在Dijkstra算法的基础上稍加改动
阅读全文
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=1869 思路:最短路+floyd分析:1 题目是要求所有的数据能否满足“六度分离”,那么我们就想到所有点之间的最短距离。2 应用floyd,如果两点之间有联系那么距离标记为1,那么最后只要判断是不是每两个人之间的距
阅读全文
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=2066 一个人的旅行 Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission
阅读全文
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=2157 How many ways?? Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total S
阅读全文
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=2546 饭卡 Time Limit: 5000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s):
阅读全文
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=2177 取(2堆)石子游戏 Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submiss
阅读全文
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=1878 欧拉回路 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s
阅读全文
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=1272 小希的迷宫 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(
阅读全文
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=1232 畅通工程 Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s
阅读全文
摘要:看了http://lovnet.iteye.com/blog/1690276的答案 好巧妙的方法 递归实现十进制向m进制转换
阅读全文
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=2057 涉及到16进制内的加法,可以用%I64x直接来处理,要注意到16进制中负数是用补码来表示的。一个比较困惑的事实是,这道题再输出时,%64X中‘X’必须是大写,小写是过不了的。 注意:__int64 %I64
阅读全文
摘要:题目:http://acm.hdu.edu.cn/showproblem.php?pid=3790 最短路径问题 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submiss
阅读全文
摘要:Time Limit: 5000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 60492 Accepted Submission(s): 26632 Problem Descr
阅读全文
摘要:2^x mod n = 1 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 16883 Accepted Submission(s): 5262
阅读全文
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=1016 Sample Input 6 8 6 8 Sample Output Case 1: 1 4 3 2 5 6 1 6 5 2 3 4 Case 2: 1 2 3 8 5 6 7 4 1 2 5 8 3 4
阅读全文

浙公网安备 33010602011771号