自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(9)
  • 收藏
  • 关注

原创 Monkey and Banana 动态规划+贪心

A group of researchers are designing an experiment to test the IQ of a monkey. They will hang a banana at the roof of a building, and at the mean time, provide the monkey with some blocks. If the monk...

2019-07-23 13:31:06 350

原创 青蛙的约会 数论 拓展欧几里德

两只青蛙在网上相识了,它们聊得很开心,于是觉得很有必要见一面。它们很高兴地发现它们住在同一条纬度线上,于是它们约定各自朝西跳,直到碰面为止。可是它们出发之前忘记了一件很重要的事情,既没有问清楚对方的特征,也没有约定见面的具体位置。不过青蛙们都是很乐观的,它们觉得只要一直朝着某个方向跳下去,总能碰到对方的。但是除非这两只青蛙在同一时间跳到同一点上,不然是永远都不可能碰面的。为了帮助这两只乐观的青蛙,...

2019-07-22 16:15:45 144

原创 欧几里德算法+拓展欧几里德算法

欧几里德算法一般简写为GCD,即辗转相除求最大公因数,模板为 ll gcd(ll a,ll b) { return b==0?a:gcd(b,a%b); } 由于这种求的方法适用于大数,所以一般数据类型采用long long int。 基于欧几里德算法,延伸出了拓展欧几里得算法,用于解决线性同余方程的问题,首先什么是线性同余方程,百度定义如下:在数论中,线性同余方程是最基本的同余方程,“...

2019-07-22 15:55:16 207

原创 Leading and Trailing 数论

You are given two integers: n and k, your task is to find the most significant three digits, and least significant three digits of nk. Input Input starts with an integer T (≤ 1000), denoting the numbe...

2019-07-22 12:23:01 143

原创 A/B 数论

要求(A/B)%9973,但由于A很大,我们只给出n(n=A%9973)(我们给定的A必能被B整除,且gcd(B,9973) = 1)。 Input 数据的第一行是一个T,表示有T组数据。 每组数据有两个数n(0 <= n < 9973)和B(1 <= B <= 10^9)。 Output 对应每组数据输出(A/B)%9973。 Sample Input 2 1000 53...

2019-07-22 12:14:54 346

原创 Ants 模拟

An army of ants walk on a horizontal pole of length l cm, each with a constant speed of 1 cm/s. When a walking ant reaches an end of the pole, it immediatelly falls off it. When two ants meet they tur...

2019-07-20 10:38:33 134

原创 Gold Coin 模拟

The king pays his loyal knight in gold coins. On the first day of his service, the knight receives one gold coin. On each of the next two days (the second and third days of service), the knight receiv...

2019-07-20 10:20:47 167

原创 Crashing Robot 模拟+水题

In a modernized warehouse, robots are used to fetch the goods. Careful planning is needed to ensure that the robots reach their destinations without crashing into each other. Of course, all warehouses...

2019-07-19 18:42:17 164

原创 Parencodings 模拟

Let S = s1 s2…s2n be a well-formed string of parentheses. S can be encoded in two different ways: q By an integer sequence P = p1 p2…pn where pi is the number of left parentheses before the ith right ...

2019-07-19 17:55:17 192

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除