博客园 首页 私信博主 显示目录 隐藏目录 管理

随笔分类 -  算法

摘要:扩展欧几里得算法是数论当中一种常用的算法,他可以用如下的姿势来表达: 设a, b为不全为0的整数,则存在整数x和y,使得 gcd(a, b) = a*x + b*y。 扩展欧几里得算法的代码实现: #include <cstdio> #include <cstring> #define ll lon 阅读全文
posted @ 2016-07-18 16:58 hfcnal 阅读(556) 评论(0) 推荐(0)
摘要:PQJ 1686(栈栈栈)用栈解决问题Time Limit:1000MSMemory Limit:10000KB64bit IO Format:%I64d & %I64uDescriptionA math instructor is too lazy to grade a qu... 阅读全文
posted @ 2015-07-21 10:06 hfcnal 阅读(354) 评论(0) 推荐(2)
摘要:栈Time Limit:3000MSMemory Limit:0KB64bit IO Format:%lld & %lluDescriptionYou are given a string consisting of parentheses()and[]. A string of this type... 阅读全文
posted @ 2015-07-20 14:57 hfcnal 阅读(1900) 评论(0) 推荐(1)
摘要:CSU 1559Time Limit:1000MSMemory Limit:131072KB64bit IO Format:%lld & %lluDescription“订外卖就上XXX,满X减Y,满X减Y...”这样的声音老回荡在我们耳旁。发传单,拉... 阅读全文
posted @ 2015-07-17 16:49 hfcnal 阅读(375) 评论(1) 推荐(1)
摘要:UVA 11389Time Limit:1000MSMemory Limit:0KB64bit IO Format:%lld & %lluDescriptionIIUCONLINE CONTEST2008The Bus Driver ProblemInput: standard inputOutpu... 阅读全文
posted @ 2015-07-17 11:50 hfcnal 阅读(358) 评论(0) 推荐(1)
摘要:CodeForces 474BTime Limit:1000MSMemory Limit:262144KB64bit IO Format:%I64d & %I64uDescriptionIt is lunch time for Mole. His friend, Marmot, prepared h... 阅读全文
posted @ 2015-07-17 10:34 hfcnal 阅读(940) 评论(0) 推荐(1)
摘要:原题Throwing cards away I Given is an ordered deck ofn cards numbered 1 to n with card 1 at the top and card n at the bottom. Thefollowing operation is... 阅读全文
posted @ 2015-07-16 21:58 hfcnal 阅读(1218) 评论(0) 推荐(1)