随笔分类 - 算法
摘要:扩展欧几里得算法是数论当中一种常用的算法,他可以用如下的姿势来表达: 设a, b为不全为0的整数,则存在整数x和y,使得 gcd(a, b) = a*x + b*y。 扩展欧几里得算法的代码实现: #include <cstdio> #include <cstring> #define ll lon
阅读全文
摘要:PQJ 1686(栈栈栈)用栈解决问题Time Limit:1000MSMemory Limit:10000KB64bit IO Format:%I64d & %I64uDescriptionA math instructor is too lazy to grade a qu...
阅读全文
摘要:栈Time Limit:3000MSMemory Limit:0KB64bit IO Format:%lld & %lluDescriptionYou are given a string consisting of parentheses()and[]. A string of this type...
阅读全文
摘要:CSU 1559Time Limit:1000MSMemory Limit:131072KB64bit IO Format:%lld & %lluDescription“订外卖就上XXX,满X减Y,满X减Y...”这样的声音老回荡在我们耳旁。发传单,拉...
阅读全文
摘要:UVA 11389Time Limit:1000MSMemory Limit:0KB64bit IO Format:%lld & %lluDescriptionIIUCONLINE CONTEST2008The Bus Driver ProblemInput: standard inputOutpu...
阅读全文
摘要:CodeForces 474BTime Limit:1000MSMemory Limit:262144KB64bit IO Format:%I64d & %I64uDescriptionIt is lunch time for Mole. His friend, Marmot, prepared h...
阅读全文
摘要:原题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...
阅读全文

浙公网安备 33010602011771号