摘要: 题意:给出x 和k,求解p和q使得等式x = p[x / k] + q [ x / k], 两个[x / k]分别为向下取整和向上取整题解:扩展欧几里得//meek///#include#include #include #include #include #include #include #in... 阅读全文
posted @ 2015-12-24 18:58 meekyan 阅读(160) 评论(0) 推荐(0) 编辑
摘要: Larry is very bad at math — he usually uses a calculator, whichworked well throughout college. Unforunately, he is now struck ina deserted island with... 阅读全文
posted @ 2015-12-24 17:55 meekyan 阅读(277) 评论(0) 推荐(0) 编辑
摘要: D. ZumaGenos recently installed the game Zuma on his phone. In Zuma there exists a line ofngemstones, thei-th of which has colorci. The goal of the ga... 阅读全文
posted @ 2015-12-24 16:43 meekyan 阅读(289) 评论(0) 推荐(0) 编辑
摘要: C. Chain ReactionThere arenbeacons located at distinct positions on a number line. Thei-th beacon has positionaiand power levelbi. When thei-th beacon... 阅读全文
posted @ 2015-12-24 12:59 meekyan 阅读(640) 评论(0) 推荐(0) 编辑
摘要: B. Hamming Distance SumGenos needs your help. He was asked to solve the following programming problem by Saitama:The length of some stringsis denoted|... 阅读全文
posted @ 2015-12-24 12:53 meekyan 阅读(416) 评论(0) 推荐(0) 编辑
摘要: A. Saitama Destroys HotelSaitama accidentally destroyed a hotel again. To repay the hotel company, Genos has volunteered to operate an elevator in one... 阅读全文
posted @ 2015-12-24 12:48 meekyan 阅读(165) 评论(0) 推荐(0) 编辑