码迷,mamicode.com
首页 >  
搜索关键字:codevs 1503 愚蠢的宠物 解题报告    ( 3864个结果
HDU 4857 Couple doubi(找循环节)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4861解题报告:桌子上有k个球 ,第i个球的价值wi =1^i+2^i+...+(p-1)^i (mod p),现在两个人轮流取,如果第一个取的人最后得到的价值总和最大,输出YES,否则 输出NO 。k和...
分类:其他好文   时间:2014-07-23 22:20:37    阅读次数:218
POJ训练计划2418_Hardwood Species(Trie树)
解题报告 Tire树。 #include #include #include #include using namespace std; struct node { int v; node *next[256]; }; int cnt=0,q; char ch[100],str1[100]; node *newnode() { node *p=new node;...
分类:其他好文   时间:2014-07-23 21:00:15    阅读次数:250
POJ2112_Optimal Milking(网洛流最大流Dinic+最短路Flody+二分)
解题报告 农场有k个挤奶机和c头牛,每头牛到每一台挤奶机距离不一样,每台挤奶机每天最多挤m头牛的奶。 寻找一个方案,安排每头牛到某一挤奶机挤奶,使得c头牛需要走的所有路程中的最大路程的最小值。 要使每一头牛都去挤奶,那么建完模型就要判断是否满流。 由于是多源多点的网络,假设源点0,汇点n+1(n=k+c) 源点到每一头牛的容量为1,每一台机器到汇点的容量为m;用flody求出任意一头牛到...
分类:其他好文   时间:2014-07-23 17:17:11    阅读次数:239
HDU 1018 Big Number (数学题)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1018解题报告:输入一个n,求n!有多少位。首先任意一个数 x 的位数 = (int)log10(x) + 1;所以n!的位数 = (int)log10(1*2*3*.......n) + 1;= (in...
分类:其他好文   时间:2014-07-23 16:24:11    阅读次数:196
HDU 4857 逃生 (优先队列+反向拓扑)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4857解题报告:有n个点,有m个条件限制,限制是像这样的,输入a b,表示a必须排在b的前面,如果不能确定两个数谁排在前面则尽量把小的排在前面。首先把出度为0的点加入到优先队列中,然后每次用优先队列中弹出...
分类:其他好文   时间:2014-07-23 15:18:56    阅读次数:212
hdu 4861 Couple doubi (找规律 )
题目链接可以瞎搞一下,找找规律题意:两个人进行游戏,桌上有k个球,第i个球的值为1i+2i+?+(p?1)i%p,两个人轮流取,如果DouBiNan的值大的话就输出YES,否则输出NO。分析:解题报告 1 #include 2 #include 3 4 using namespace std;...
分类:其他好文   时间:2014-07-23 11:37:56    阅读次数:221
leetCode解题报告5道题(六)
题目一:Longest Substring Without Repeating CharactersGiven a string, find the length of the longest substring without repeating characters. For example, ...
分类:其他好文   时间:2014-07-22 23:04:12    阅读次数:246
HNU 12817 Shipura(表达式求值)
题目链接:http://acm.hnu.cn/online/?action=problem&type=show&id=12817解题报告:定义两种运算符号,一种是>>,就是右移,另一种是S,S = (X^2) % (1e9+7);跟其它表达式求值一样,用两个栈,一个存操作数,另一个存操作符,有一个问...
分类:其他好文   时间:2014-07-22 22:50:14    阅读次数:261
Codeforces Round #257 (Div. 2/A)/Codeforces450A_Jzzhu and Children
解题报告 没什么好说的,大于m的往后面放,,,re了一次,,, #include #include #include #include using namespace std; struct node { int x,cd; }num[1000000]; int main() { int n,m,c; cin>>n>>m; int i; for...
分类:其他好文   时间:2014-07-22 22:49:16    阅读次数:247
Codeforces Round #257 (Div. 2/B)/Codeforces450B_Jzzhu and Sequences
解题报告 算是规律题吧,,,x y z -x -y -z 注意的是如果数是小于0,要先对负数求模再加模再求模 给我的戳代码跪了,,, #include #include #include using namespace std; long long x,y,z; long long n; int main() { cin>>x>>y; cin>>n; z=y...
分类:其他好文   时间:2014-07-22 22:49:15    阅读次数:225
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!