1 weixin_43244265

尚未进行身份认证

暂无相关简介

等级
TA的排名 3w+

Codeforces 219C Color Stripe

A colored stripe is represented by a horizontal row of n square cells, each cell is pained one of k colors. Your task is to repaint the minimum number of cells so that no two neighbouring cells are of...

2020-02-23 13:18:28

Codeforces134Div.2-C(并查集)

Bajtek is learning to skate on ice. He’s a beginner, so his only mode of transportation is pushing off from a snow drift to the north, east, south or west and sliding until he lands in another snow dr...

2020-02-22 23:55:44

uva 11237 - Halloween treats(鸽笼原理)

题意:有c个小孩要到邻居家去要糖果,有n户邻居,每户邻居只会提供固定数量的糖果,熊孩子们为了不发生冲突,决定将取来的糖果平均分配,问说取那几家邻居的糖果可以做到平均分配,注意n ≥ c思路:因为n<m,所以m个前缀和分别对孩子数(n)求余,至少有两个余数一样的一组(鸽笼原理),这两组的差肯定是n的倍数,输出两个前缀和序号之间的数就可以。AC代码:#include<iostream...

2020-02-22 20:09:31

扩展欧几里得求通解、最小正整数解

扩欧求出来的解x,y是方程:ax+by=gcd(a,b)的解x0=x*c/gcdy0=y*c/gcdx0,y0是方程ax+by=c的解那么怎么求方程ax+by=c的通解呢?让x0向左、右平移n格,y的变化(n为整数)y0=(c-a*x0)/by1=(c-ax1)/b=(c-a(x0+n))/b=y0-a/b*n也就是说x1=x0+n;y1=y0-a/b*n把a/b转换为整数:x...

2020-02-21 15:22:11

UVA_10664_Luggage(水题)

Peter and his friends are on holiday, so they have decided to make a trip by car to know the north ofSpain. They are seven people and they think that two cars are enough for their luggage.It’s time ...

2020-02-20 17:23:09

UVA - 1404 Prime k-tuple【筛素数】

{p1, . . . , pk : p1 < p2 < . . . < pk} is called a prime k-tuple of distance s if p1, p2, . . . , pk are consecutiveprime numbers and pk − p1 = s. For example, with k = 4, s = 8, {11, 13, 1...

2020-02-19 17:17:44

UVA 10236 - The Fibonacci Primes(斐波那契素数)

The Fibonacci number sequence is 1, 1, 2, 3, 5, 8, 13 and so on. You can see that except the first twonumbers the others are summation of their previous two numbers. A Fibonacci Prime is a Fibonacci...

2020-02-19 16:37:39

2.17训练日记

过混了头了,昨天忘了总结了,罪过罪过。本来以为前天的CF打的还行,前两个题一遍过,第二个题一开始看错题了但好歹最后出来了,第三个没时间出了也没觉得亏,一般情况也出不来,可谁知道前天的c题这么简单,亏了亏了。。。这两天过的浑浑噩噩的,感觉刷题有困难了就去补课,可也没给自己定个计划,祸祸了好几天也没感觉学了点什么,还是回来刷题比较安心。...

2020-02-17 20:22:50

UVA10689-Yet another Number Sequence(矩阵快速幂)

Let’s define another number sequence, given by the following function:f(0) = af(1) = bf(n) = f(n − 1) + f(n − 2), n > 1When a = 0 and b = 1, this sequence gives the Fibonacci Sequence. Changing...

2020-02-17 17:14:21

2.12训练日记

最近做题有点烦躁,一个是题目比较难了,大多都现靠研究题解弄明白的,没有了自己做的成就感,再就是CF一直在掉分,Div2要想得分至少得做出三个,可现在就两个题的水平,Div3手慢了掉的比Div’2还狠,眼看着分往下掉,菜到不行。今天做到一个题,大数的质数筛法,用的是先筛小数然后用小数筛大数,不是很难理解但愣是看了一下午,之前这些基础性的知识看博客的时候看过去一遍就没再去看,用的时候还得现看模板,现在...

2020-02-13 01:10:34

UVA701 LA5637 The Archeologists' Dilemma

An archeologist seeking proof of the presence of extraterrestrials in the Earth’s past, stumbles upon apartially destroyed wall containing strange chains of numbers. The left-hand part of these lines...

2020-02-11 15:52:56

2.9训练日记

啊,今晚的CF亏大了,记错时间了,一直以为是十点半,开始打的时候人家已经开始半个小时了,前两个水的不要不要的,很快就过了,第三个的位运算是真玩不转,本来能拿个两个题的前排来就算加不了分也不至于扣分,这次直接调到后排去这次肯定扣惨了,亏大了。以后得长点心吧。。。...

2020-02-10 00:11:56

UVA 10515 - Powers Et Al

Finding the exponent of any number can be very troublesome as it grows exponentially. But in thisproblem you will have to do a very simple task. Given two non-negative numbers m and n, you willhave ...

2020-02-08 16:46:34

POJ 1320 Street Numbers(佩尔方程)

DescriptionA computer programmer lives in a street with houses numbered consecutively (from 1) down one side of the street. Every evening she walks her dog by leaving her house and randomly turning l...

2020-02-07 15:07:09

2.5训练日记

现在发现数学推导是多么的重要,很多题目不在纸上推一遍根本不行,但对自己的推导能力也是服了气了,很多都是是推到一半或推到一大半推不动了,就像那个分珠子的题,就最后一步死活推不动,数论里的推导不像数学考试那样给你头给你尾让你推过程,这里是只给你头,给你问题,整个过程中得不到半点方向的提示,尤其是面对新知识的时候,你能凭借的就是经验和感觉,就像上次那个欧拉降幂的题,和那个二项式定理化简f(x+1)=5*...

2020-02-05 22:39:09

Codeforces C. Yet Another Walking Robot(2月5日)

There is a robot on a coordinate plane. Initially, the robot is located at the point (0,0). Its path is described as a string s of length n consisting of characters ‘L’, ‘R’, ‘U’, ‘D’.Each of these c...

2020-02-05 17:00:20

UVA 10110(开关)

There is man named ”mabu” for switching on-off light in our University. He switches on-off the lightsin a corridor. Every bulb has its own toggle switch. That is, if it is pressed then the bulb turns...

2020-02-05 14:01:09

POJ 1218 THE DRUNK JAILER(开关问题)

Description一个监狱看守员喝醉了酒,于是把监狱每扇门都打开(假设有n扇门);然后再从1号门开始,隔一扇关一个门(把2的倍数的门关掉);接着再从1号门开始,隔2扇操作一个门(操作3的倍数的门,原来是开的关掉,关着的则打开)。这样一直操作到n的倍数,问最后有多少扇门是打开的。这个也可以叫关灯问题:有n个灯,分别由n个开关控制,拨一下开关则可以改变灯的状态(开->关 关->开)。...

2020-02-05 12:55:39

2.3训练日记

昨天谷歌终于给力一回了,让我打了个完整得CF,虽然依旧得菜但起码好过进不去得烦躁,昨天过了两个题,应该是掉分了(我也不知道掉多少,今天网站又进不去了。。。。),第三题挂得不冤,真没思路,换了好多种方法都行不通,前两个因为漏掉了条件错了一发,因为手滑把大于小于号写反了错了一发,实在不应该,这麽久没打比赛了过程中还是有点慌,打出来没有平时一遍遍验得耐心,就想早点交早点过,出了很多低级错误。以后得训练中...

2020-02-03 22:46:42

UVA10090 Marbles(扩展欧几里得)

I have some (say, n) marbles (small glass balls) and I am going to buy some boxes to store them. Theboxes are of two types:T ype 1: each box costs c1 Taka and can hold exactly n1 marblesT ype 2: ea...

2020-02-03 22:25:37

查看更多

勋章 我的勋章
  • 持之以恒
    持之以恒
    授予每个自然月内发布4篇或4篇以上原创或翻译IT博文的用户。不积跬步无以至千里,不积小流无以成江海,程序人生的精彩需要坚持不懈地积累!
  • 1024勋章
    1024勋章
    #1024程序员节#活动勋章,当日发布原创博客即可获得
  • 勤写标兵Lv4
    勤写标兵Lv4
    授予每个自然周发布9篇以上(包括9篇)原创IT博文的用户。本勋章将于次周上午根据用户上周周三的博文发布情况由系统自动颁发。