![](https://img-blog.csdnimg.cn/20201014180756780.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
水题
mc_chang
good good study,day day up!
展开
-
A+B in Hogwarts(进位加法)
1058. A+B in HogwartsIf you are a fan of HarryPotter, you would know the world of magic has its own currency system -- asHagrid explained it to Harry, "Seventeen silver Sickles to a Galleon andtwenty-...原创 2018-03-11 16:07:31 · 220 阅读 · 0 评论 -
Have Fun with Numbers(大数相加)
Have Fun with Numbers Notice that the number 123456789 is a 9-digit number consisting exactly the numbers from 1 to 9, with no duplication. Double it we will obtain 246913578, which happens to be anot...原创 2018-03-12 10:30:20 · 196 阅读 · 0 评论 -
A^B(A的B次方)——人见人爱A^B,Rightmost Digit 。
写一个pow()函数计算A的B次方取余10,即求所得结果的个位数。int pow(int a, int b){ if(b==0) return 1; int half = (pow(a,b>>1))%10; if(b%2==0) return (half*half)%10; else return (half*half*a)%101;原创 2017-08-29 15:44:02 · 509 阅读 · 0 评论 -
蓝桥 分巧克力(二分)
问题描述 儿童节那天有K位小朋友到小明家做客。小明拿出了珍藏的巧克力招待小朋友们。 小明一共有N块巧克力,其中第i块是Hi x Wi的方格组成的长方形。 为了公平起见,小明需要从这 N 块巧克力中切出K块巧克力分给小朋友们。切出的巧克力需要满足: 1. 形状是正方形,边长是整数 2. 大小相同 例如一块6x5的巧克力可以切出6块2x2的巧克力或者2块3x3的巧克力。 当然小朋友们都希...原创 2018-03-22 21:10:20 · 225 阅读 · 0 评论