
其他OJ
文章平均质量分 76
liuzhushiqiang
这个作者很懒,什么都没留下…
展开
-
LA 3027 Corporative Network
算法思路:带权并查集。但是要注意“权值”的选取,下面的代码采取的方案是:初始的时候保存每个节点到父节点的距离d[i], 当进行一次findset的时候同时压缩路径和依次更新路径上的每个结点的d[i], 使得此时的的d[i]为该节点到根节点的距离,执行findset 后cout代码来源:刘汝佳 - 信息学竞赛入门经典(强烈推荐,难得的好书)//模板开始#include转载 2013-07-04 17:54:56 · 572 阅读 · 0 评论 -
UVa 10123 - No Tipping
算法思路:暴力法,回溯。自己在别人的题解上把题目看懂了,考察 物理+贪心+DFS剪枝。可惜自己物理知识给忘了,求”两个支点的平衡问题“没什么想法,只知道一个支点的力矩计算有公式。╮(╯▽╰)╭书到用时方恨少。不过,个人还是非常喜欢这种题目的,理论和应用结合的非常好,还带一点学科交叉。下面是转载的别人的blog:Problem A - No TippingAs Archime转载 2013-08-07 17:46:11 · 724 阅读 · 0 评论 -
UVa 10160 - Servicing Stations
算法思路:回溯,暴力。以下转载了两个版本:版本10.032msAC。// Servicing Stations (服务站)// PC/UVa IDs: 110804/10160, Popularity: B, Success rate: low Level: 3// Verdict: Accepted // Submission Date: 2011-08-10// UVa转载 2013-08-07 20:37:05 · 728 阅读 · 0 评论 -
UVa 10023 - Square root
这种大数开方的算法很神奇,步骤很简单,但是自己没有理解它的核心原理。下面是转载的blog:数学题(我更觉得是恶心模拟)题意很清楚,就是给一个高精度整数,求它的平方根,数据保证一定是整数解这个东西要用高精度各种搞(看过别人的报告说有些不用高精度,没心机看下去,自己硬是写了一堆高精度),主要就是模拟手算的方法手算的方法这里说得很清楚了(希望看得到图片吧)转载 2013-08-06 11:28:00 · 802 阅读 · 0 评论 -
UVa 138 - Street Numbers (门牌号)
Time limit: 3.000 seconds限时3.000秒 Problem问题A computer programmer lives in a street with houses numbered consecutively (from 1) down one side of the street. Every evening she walks her dog by转载 2013-08-06 10:43:52 · 663 阅读 · 0 评论 -
厦大oj1438简单题、map
#include #include #include #include using namespace std; int main(){ map tongji; map::iterator it; int shuru1 = 0; cin>>shuru1; ifstream ifs("shuju.txt");//原创 2013-04-18 21:42:59 · 1611 阅读 · 0 评论 -
poj1001简单题
#includeusing namespace std;int main(){ int m, n; while(cin>>m>>n) cout<<m + n<<endl; return 0;}原创 2013-02-22 00:28:56 · 313 阅读 · 0 评论 -
厦大oj1438简单题、数学题(积分、几何概率、求最大公约数)
#include #include #include using namespace std; int time_to_int(string time){ int time_int = 0; int hour = 0; int minute = 0; if(time[0] != '0'){原创 2013-04-20 18:20:10 · 1175 阅读 · 0 评论