自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 本人已转至cnblog!

17年年底才接触的算法竞赛,所以很多地方做的都很不好,如果内容有什么问题请联系我!链接:http://www.cnblogs.com/wrjlinkkkkkk/

2018-08-26 22:10:11 1538 1

原创 2018天梯赛、蓝桥杯、(CCPC省赛、邀请赛、ICPC邀请赛)校内选拔赛反思总结!

    才四月份,上半年的比赛就告一段落了。。    天梯赛混子,三十个人分最低,把队友拖到了国三,蓝桥杯省二滚粗,止步京城,旅游选拔赛成功选为替补二队,啊!    不过既然已经过去,我们说些乐观的一面,积累了大赛经验是肯定的,明年是肯定要继续的,放弃是不可能放弃的。挨个分析一下这几场比赛的总结:    1.天梯赛。模拟赛的时候就感觉自己速度不太行,虽然练了一个星期,比赛的时候还是遇到了状况。首先...

2018-04-10 21:19:42 5567

原创 Codevs 1205 单词反转(Vector以及如何输出string)

题意:倒序输出句子中的单词代码:#include<cstdio>#include<iostream>#include<string>#include<cmath>#include<cstring>#include<algorithm>#include<set>#include<queue

2018-05-17 18:47:43 199

原创 Codeforces 977D Divide by three, multiply by two(拓扑排序)

Polycarp likes to play with numbers. He takes some integer number xx, writes it down on the board, and then performs with it n−1n−1operations of the two kinds:divide the number xx by 33 (xx must be di...

2018-05-12 17:14:12 251

原创 Codeforces 977B Two-gram(stl之string掉进坑)

Two-gram is an ordered pair (i.e. string of length two) of capital Latin letters. For example, "AZ", "AA", "ZA" — three distinct two-grams.You are given a string ss consisting of nn capital Latin lett...

2018-05-12 16:08:01 248

原创 HDU 6186 CS Course (连续位运算)

CS CourseTime Limit: 4000/2000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 430    Accepted Submission(s): 222Problem DescriptionLittle A has come to college and m...

2018-04-19 13:56:54 265

原创 HDU 1005 Number Sequence(矩阵快速幂,快速幂模板)

Problem DescriptionA number sequence is defined as follows:f(1) = 1, f(2) = 1, f(n) = (A * f(n - 1) + B * f(n - 2)) mod 7.Given A, B, and n, you are to calculate the value of f(n). InputThe input cons...

2018-04-16 20:35:54 236

原创 HDU 1004 Let the Balloon Rise(STL初体验之map)

Problem DescriptionContest time again! How excited it is to see balloons floating around. But to tell you a secret, the judges' favorite time is guessing the most popular problem. When the contest is ...

2018-04-16 19:14:06 164

原创 Newcoder Wannafly13 B Jxy军训(费马小定理、分数在模意义下的值)

链接:https://www.nowcoder.com/acm/contest/80/B题目描述 在文某路学车中学高一新生军训中,Jxc正站在太阳下站着军姿,对于这样的酷热的阳光,Jxc 表示非常不爽。 Jxc将天空看做一个n*n的矩阵,此时天上有m朵云,这些云会随机分布在m个不同的位置,同时太阳会随机出现在一个位置,Jxc想知道他被太阳晒到的概率是多少,由于他仍在站军姿,所以这...

2018-04-07 16:51:39 419

原创 Codeforces 961C Chessboard(将碎了的、染色乱了的棋盘碎片拼一起)

题目链接:点击打开链接Magnus decided to play a classic chess game. Though what he saw in his locker shocked him! His favourite chessboard got broken into 4pieces, each of size n by n, n is always odd. And what's...

2018-04-06 00:34:34 510

原创 PTA 7-10 树的遍历(二叉树基础、层序遍历、STL初体验之queue)

7-10 树的遍历(25 分)给定一棵二叉树的后序遍历和中序遍历,请你输出其层序遍历的序列。这里假设键值都是互不相等的正整数。输入格式:输入第一行给出一个正整数N(≤30),是二叉树中结点的个数。第二行给出其后序遍历序列。第三行给出其中序遍历序列。数字间以空格分隔。输出格式:在一行中输出该树的层序遍历的序列。数字间以1个空格分隔,行首尾不得有多余空格。输入样例:72 3 1 5 7 6 41 ...

2018-03-28 12:50:39 538

原创 PTA 7-9 集合相似度(STL之set初体验)

7-9 集合相似度(25 分)给定两个整数集合,它们的相似度定义为:N​c​​/N​t​​×100%。其中N​c​​是两个集合都有的不相等整数的个数,N​t​​是两个集合一共有的不相等整数的个数。你的任务就是计算任意一对给定集合的相似度。输入格式:输入第一行给出一个正整数N(≤50),是集合的个数。随后N行,每行对应一个集合。每个集合首先给出一个正整数M(≤10​4​​),是集合中元素的个数;然后...

2018-03-27 21:10:19 276

原创 POJ 1751 Highways(最小生成树Prim普里姆,输出边)

题目链接:点击打开链接DescriptionThe island nation of Flatopia is perfectly flat. Unfortunately, Flatopia has a very poor system of public highways. The Flatopian government is aware of this problem and has alre...

2018-03-26 23:34:51 296

原创 Codeforces 924 A Tritonic Iridescence(暴力集合交集、相等)

题目链接:点击打开链接There is a rectangular grid of n rows of m initially-white cells each.Arkady performed a certain number (possibly zero) of operations on it. In the i-th operation, a non-empty subset of row...

2018-03-26 16:52:20 407

原创 POJ 1789 Truck History (Kruskal最小生成树) 模板题

DescriptionAdvanced Cargo Movement, Ltd. uses trucks of different types. Some trucks are used for vegetable delivery, other for furniture, or for bricks. The company has its own code describing each t...

2018-03-25 11:46:46 160

原创 牢记gcd最大公因数和lcm最小公倍数

  由于不会辗转相除法,在不能带资料的比赛中肯定会吃亏。上次天体报名赛就现场找规律写了个gcd,虽然过了但是很丢人啊啊啊。。  直接进入正题,gcd有以下恒等式:gcd(a, b) = gcd (a, a mod b),并且边界条件gcd(a, 0) = a;这里假设a>=b 于是gcd函数就出来了int gcd(int a, int b){ return b == 0 ? a : ...

2018-03-24 22:43:56 481

原创 Codeforces 922 E Birds (背包dp)被define坑了的一题

网页链接:点击打开链接Apart from plush toys, Imp is a huge fan of little yellow birds!To summon birds, Imp needs strong magic. There are n trees in a row on an alley in a park, there is a nest on each of the tre...

2018-03-21 00:24:48 236

原创 HDU 1251 统计难题 (Trie树模板题)

题目链接:点击打开链接Problem DescriptionIgnatius最近遇到一个难题,老师交给他很多单词(只有小写字母组成,不会有重复的单词出现),现在老师要他统计出以某个字符串为前缀的单词数量(单词本身也是自己的前缀). Input输入数据的第一部分是一张单词表,每行一个单词,单词的长度不超过10,它们代表的是老师交给Ignatius统计的单词,一个空行代表单词表的结束.第二部分是一连串...

2018-03-19 23:24:24 174

原创 codeforces 922 B. Magic Forest(枚举、位运算(异或))

题目链接:点击打开链接Imp is in a magic forest, where xorangles grow (wut?)A xorangle of order n is such a non-degenerate triangle, that lengths of its sides are integers not exceeding n, and the xor-sum of the ...

2018-03-19 18:05:04 152

原创 Codeforces 922 C - Robot Vacuum Cleaner (贪心、数据结构、sort中的cmp)

题目链接:点击打开链接Pushok the dog has been chasing Imp for a few hours already.Fortunately, Imp knows that Pushok is afraid of a robot vacuum cleaner.While moving, the robot generates a string t consisting of...

2018-03-19 17:48:35 407

原创 HDU 3068 最长回文 (Manacher最长回文串)

Problem Description给出一个只由小写英文字符a,b,c...y,z组成的字符串S,求S中最长回文串的长度.回文就是正反读都是一样的字符串,如aba, abba等 Input输入有多组case,不超过120组,每组输入为一行小写英文字符a,b,c...y,z组成的字符串S两组case之间由空行隔开(该空行不用处理)字符串长度len <= 110000 Output每一行一个整...

2018-03-15 16:40:28 190 1

原创 Codeforces Round #470 (Div. 2) A Protect Sheep (基础)输入输出的警示、边界处理

Bob is a farmer. He has a large pasture with many sheep. Recently, he has lost some of them due to wolf attacks. He thus decided to place some shepherd dogs in such a way that all his sheep are protec...

2018-03-11 23:39:46 227

原创 HDU 2087 剪花布条 KMP极其初级之入门题(KMP模板在这里)

Problem Description一块花布条,里面有些图案,另有一块直接可用的小饰条,里面也有一些图案。对于给定的花布条和小饰条,计算一下能从花布条中尽可能剪出几块小饰条来呢? Input输入中含有一些数据,分别是成对出现的花布条和小饰条,其布条都是用可见ASCII字符表示的,可见的ASCII字符有多少个,布条的花纹也有多少种花样。花纹条和小饰条不会超过1000个字符长。如果遇见#字符,则不再...

2018-03-08 20:47:17 141

原创 Educational Codeforces Round 39 Editorial B(Euclid算法,连续-=与%=的效率)

You have two variables a and b. Consider the following sequence of actions performed with these variables:If a = 0 or b = 0, end the process. Otherwise, go to step 2;If a ≥ 2·b, then set the value of ...

2018-03-07 16:20:24 237

空空如也

空空如也

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

TA关注的人

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