我的博客
Yyxiaobb
这个作者很懒,什么都没留下…
展开
-
Eight
Eight The 15-puzzle has been around for over 100 years; even if you don’t know it by that name, you’ve seen it. It is constructed with 15 sliding tiles, each with a number from 1 to 15 on it, and all ...原创 2019-07-21 18:36:53 · 256 阅读 · 0 评论 -
Arbitrage
Arbitrage Arbitrage is the use of discrepancies in currency exchange rates to transform one unit of a currency into more than one unit of the same currency. For example, suppose that 1 US Dollar buys ...原创 2019-07-28 18:34:52 · 328 阅读 · 0 评论 -
Binary Tree
Binary Tree Background Binary trees are a common data structure in computer science. In this problem we will look at an infinite binary tree where the nodes contain a pair of integers. The tree is con...原创 2019-07-28 18:26:33 · 283 阅读 · 0 评论 -
Points in rectangle
Points in rectangle 在二维平面中有一个矩形,它的四个坐标点分别为(0,a),(a,0),(n,n−a),(n−a,n)。你现在有m个点,现在你想知道有多少个点是在这个矩形内的(边上的也算)。 输入格式 第一行输入n,a(1≤a<n≤103)。 第二行一个正整数m(1≤m≤103),代表你拥有的点的个数,接下来m行,每行一个点的坐标xi,yi(1≤xi,yi≤103)。 输...原创 2019-07-27 16:54:39 · 422 阅读 · 0 评论 -
恐怖的怪物
恐怖的怪物 一天早上,Dicer一觉醒来,发现自己来到了MineCraft的世界里面,身为MineCraft游戏爱好者的他欣喜不已,于是他在地下挖了一片长方体的空间作为秘密基地,可是他发现光照亮度小于等于7时,会有恐怖的怪物出现,并且他通过查阅资料发现光源方块产生光照每一米(方格)衰减1光照等级。 此规律在坐标轴的3个方向上(东西、南北、上下)均成立。换句话来说,对角线方向的光照衰减依照“曼哈顿距...原创 2019-07-27 21:42:38 · 341 阅读 · 0 评论 -
Numbers of interval
Numbers of interval 现在有一个数组,请计算有多少的区间l,r满足 ∑ri=lai≥k. 输入格式 第一行输入n,k(1≤n,k≤106). 接下来输入n个数,第i个数为ai(1≤ai≤103). 输出格式 输出满足条件的区间个数 input 3 5 2 3 5 output 4 感慨:这道题是一道比赛题,刚开始做的时候脑子抽了,竟然给他排了一下序,果断错了,我当时一脸懵逼,...原创 2019-07-27 16:42:45 · 440 阅读 · 0 评论 -
超级密码
超级密码 Ignatius花了一个星期的时间终于找到了传说中的宝藏,宝藏被放在一个房间里,房间的门用密码锁起来了,在门旁边的墙上有一些关于密码的提示信息: 密码是一个C进制的数,并且只能由给定的M个数字构成,同时密码是一个给定十进制整数N(0<=N<=5000)的正整数倍(如果存在多个满足条件的数,那么最小的那个就是密码),如果这样的密码存在,那么当你输入它以后门将打开,如果不存原创 2019-06-03 17:45:19 · 1054 阅读 · 0 评论 -
Sticks
Sticks George took sticks of the same length and cut them randomly until all parts became at most 50 units long. Nowhewantstoreturnstickstotheoriginalstate,butheforgothowmanystickshehadoriginally and ...原创 2019-07-21 18:47:42 · 364 阅读 · 0 评论 -
Find The Multiple
Find The Multiple Given a positive integer n, write a program to find out a nonzero multiple m of n whose decimal representation contains only the digits 0 and 1. You may assume that n is not greater ...原创 2019-07-22 08:35:32 · 227 阅读 · 0 评论 -
Watering Grass
Watering Grass n sprinklers are installed in a horizontal strip of grass l meters long and w meters wide. Each sprinkler is installed at the horizontal center line of the strip. For each sprinkler we ...原创 2019-07-22 08:36:42 · 286 阅读 · 0 评论 -
Addition Chains
Addition Chains An addition chain for n is an integer sequence <a0, a1,a2,…,am> with the following four properties: a0 = 1 am = n a0 < a1 < a2 < … < am-1 < am For each k (1 <= ...原创 2019-07-21 19:19:50 · 688 阅读 · 0 评论 -
Maximum Sum
Maximum Sum A problem that is simple to solve in one dimension is often much more difficult to solve in more than one dimension. Consider satisfying a boolean expression in conjunctive normal form in ...原创 2019-07-22 08:36:07 · 258 阅读 · 0 评论 -
Sorting It All Out
Sorting It All Out An ascending sorted sequence of distinct values is one in which some form of a less-than operator is used to order the elements from smallest to largest. For example, the sorted seq...原创 2019-07-28 18:42:19 · 359 阅读 · 0 评论