自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 网页小例子2

HTML:CSS:JS:

2020-06-15 16:47:26 223

原创 网页小例子

HTML:CSS:JS:

2020-06-15 16:40:29 234

原创 素数圆环(dfs)

链接:https://ac.nowcoder.com/acm/contest/3474/C来源:牛客网一个由n个圆圈构成的圆环。将自然数1,2,…,n放入圆圈内,并且要求任意两个相邻的圆圈内的数字之和为素数。请问给你圆圈数,你能给出放置自然数的所有正确方案吗?注意:圆圈中的数字一定是从1开始的,并且连续不重复。#include <bits/stdc++.h>using ...

2019-12-21 13:59:06 775

原创 Red/Blue Spanning Tree

Problem DescriptionGiven an undirected, unweighted, connected graph, where each edge is colored either blue or red, determine whether a spanning tree with exactly k blue edges exists.InputThere wil...

2019-11-30 13:06:14 209

原创 Rectangles(搜索)

描述A rectangle in the Cartesian plane is specified by a pair of coordinates (x1 , y1) and (x2 , y2) indicating its lower-left and upper-right corners, respectively (where x1 <= x2 and y1 <= y2)....

2019-11-19 19:42:12 261

原创 Hard math problem(递归)

描述Xioumu was trapped by a mathematical puzzle recently.He wrote the number 0,1,2 on the blackboard, and then he does lots of operations on them, in each operation, he took out the larger two numbers...

2019-11-19 19:26:04 364

原创 Detachment

Problem DescriptionIn a highly developed alien society, the habitats are almost infinite dimensional space.In the history of this planet,there is an old puzzle.You have a line segment with x units’...

2019-11-17 16:59:48 249

原创 Riding the Fences(欧拉回路)

描述Farmer John owns a large number of fences that must be repaired annually. He traverses the fences by riding a horse along each and every one of them (and nowhere else) and fixing the broken parts....

2019-11-17 16:30:03 214

原创 逃生(拓扑排序,反向)

描述糟糕的事情发生啦,现在大家都忙着逃命。但是逃命的通道很窄,大家只能排成一行。现在有n个人,从1标号到n。同时有一些奇怪的约束条件,每个都形如:a必须在b之前。同时,社会是不平等的,这些人有的穷有的富。1号最富,2号第二富,以此类推。有钱人就贿赂负责人,所以他们有一些好处。负责人现在可以安排大家排队的顺序,由于收了好处,所以他要让1号尽量靠前,如果此时还有多种情况,就再让2号尽量靠前,如...

2019-11-17 16:21:50 257 1

原创 Mine Sweeping

描述The opening ceremony of the 28th Asia Game is coming. In order to prevent the game from being attacked by terrorists, Asia Compete Machinery (ACM) takes lots operations as security measures.Mine s...

2019-11-13 20:20:27 241

原创 Just Pour the Water

描述Shirly is a very clever girl. Now she has two containers (A and B), each with some water. Every minute, she pours half of the water in A into B, and simultaneous pours half of the water in B into A...

2019-11-13 20:06:14 1296

原创 Changlong's bother

描述Changlong is a handsome and clever boy and he is admired by many beautiful girls. Every day he received tens of thousands of letters form girls which express their intense desire to be his life com...

2019-11-13 19:43:38 153

原创 sum(简单题)

描述Given a sequence, you’re asked whether there exists a consecutive subsequence whose sum is divisible by m. output YES, otherwise output NO输入The first line of the input has an integer T (1≤T≤10), ...

2019-11-03 16:50:23 392

原创 LCM Walk

描述A frog has just learned some number theory, and can’t wait to show his ability to his girlfriend.Now the frog is sitting on a grid map of infinite rows and columns. Rows are numbered 1,2,⋯ from th...

2019-11-03 16:39:21 295

原创 Dominos 2(dfs)

描述Dominos are lots of fun. Children like to stand the tiles on their side in long lines. When one domino falls, it knocks down the next one, which knocks down the one after that, all the way down the...

2019-11-03 15:58:48 432

原创 Anniversary party(最基础的树形dp)

描述There is going to be a party to celebrate the 80-th Anniversary of the Ural State University. The University has a hierarchical structure of employees. It means that the supervisor relation forms a...

2019-11-02 16:24:11 262

原创 The Best Path(欧拉路)

Problem DescriptionAlice is planning her travel route in a beautiful valley. In this valley, there are N lakes, and M rivers linking these lakes. Alice wants to start her trip from one lake, and enjo...

2019-11-02 16:09:55 151

原创 A Walk Through the Forest(最短路+搜索)

描述Jimmy experiences a lot of stress at work these days, especially since his accident made working difficult. To relax after a hard day, he likes to walk home. To make things even nicer, his office i...

2019-11-01 20:32:32 309 1

原创 确定比赛名次(拓扑排序)

描述有N个比赛队(1<=N<=500),编号依次为1,2,3,。。。。,N进行比赛,比赛结束后,裁判委员会要将所有参赛队伍从前往后依次排名,但现在裁判委员会不能直接获得每个队的比赛成绩,只知道每场比赛的结果,即P1赢P2,用P1,P2表示,排名时P1在P2之前。现在请你编程序确定排名。输入输入有若干组,每组中的第一行为二个数N(1<=N<=500),M(0<=M...

2019-10-29 19:35:22 258

原创 Happy Necklace(矩阵快速幂)

Problem DescriptionLittle Q wants to buy a necklace for his girlfriend. Necklaces are single strings composed of multiple red and blue beads.Little Q desperately wants to impress his girlfriend, he ...

2019-10-27 16:25:59 164

原创 GCD(欧拉函数)

描述The greatest common divisor GCD(a,b) of two positive integers a and b,sometimes written (a,b),is the largest divisor common to a and b,For example,(1,2)=1,(12,18)=6.(a,b) can be easily found by th...

2019-10-26 16:19:16 395

原创 Following Orders(拓扑排序)

DescriptionOrder is an important concept in mathematics and in computer science. For example, Zorn’s Lemma states: ``a partially ordered set in which every chain has an upper bound contains a maximal...

2019-10-26 15:31:09 744

原创 取石子游戏&&Game of Taking Stones

取石子游戏Problem Description有两堆石子,数量任意,可以不同。游戏开始由两个人轮流取石子。游戏规定,每次有两种不同的取法,一是可以在任意的一堆中取走任意多的石子;二是可以在两堆中同时取走相同数量的石子。最后把石子全部取完者为胜者。现在给出初始的两堆石子的数目,如果轮到你先取,假设双方都采取最好的策略,问最后你是胜者还是败者。Input输入包含若干行,表示若干种石子的初始情...

2019-10-25 19:51:03 907

原创 A Simple Math Problem

Problem DescriptionGiven two positive integers a and b,find suitable X and Y to meet the conditions:X+Y=aLeast Common Multiple (X, Y) =bInputInput includes multiple sets of test data.Each test da...

2019-10-25 19:14:29 245

原创 Wrestling Match(图、搜索)

Problem DescriptionNowadays, at least one wrestling match is held every year in our country. There are a lot of people in the game is "good player”, the rest is "bad player”. Now, Xiao Ming is refere...

2019-10-22 19:28:51 685

原创 Adrien and Austin

先手中间对半取数字,如果能成功使剩下的左右两边的数量相同就先手胜(后手拿什么,先手跟着拿一样的),否则后手胜#include <bits/stdc++.h>using namespace std;int main(){ int n,k; cin>>n>>k; if(n==0||(n%2==0&&k==1)){ ...

2019-10-19 21:18:54 267

原创 Nim(尼姆游戏)

尼姆游戏的规则:有n堆石子,数量分别是{a1,a2,a3,…,an},两个玩家轮流拿石子,每次从任意一堆中拿走任意数量的石子,拿到最后一个石子的玩家获胜。尼姆游戏有个极为简单的判断胜负的方法,即做异或运算(在这之前要了解一下巴什游戏中的P-position和N-position)定理:若a1⊕a2⊕a3⊕…⊕an!=0则先手必胜,此时是N-position若a1⊕a2⊕a3⊕…⊕an=...

2019-10-16 21:07:46 8110

转载 母函数的学习

一个杭电的课件:杭电课件——母函数很详细再来一个大佬的详细讲解,加深印象:添加链接描述

2019-10-15 21:12:19 116

原创 矩阵快速幂

一个矩阵求它的n次幂,可以把矩阵看成是变量,通过快速幂(快速幂见快速幂总结)的方法来求前提小知识:俩个矩阵能够相乘那么前一个矩阵的行数和后一个矩阵的列数是相同的,所以如果是幂的话这个矩阵就是n行n列的struct matrix{ int m[n][n];//n行 n列 matrix(){memset(m,0,sizeof(m));}};matrix matrix_mul(m...

2019-10-15 20:48:18 131

原创 快速幂,快速乘总结

快速幂O(n)的方法:an=aaa*…n大就会超时O(log2n)的方法:方法一:先算a2再算(a2)2一直到n次幂,判断一下奇偶数int fastpow(int a,int n){//a^n if(n==1) return a; int t=fastpow(a,n/2); if(n&1){ return t*t*a; }els...

2019-10-12 20:09:23 186

原创 Honeycomb(bfs)

题目A honeycomb is a mass wax cells built by honey bees, which can be described as a regular tiling of the Euclidean plane, in which three hexagons meet at each internal vertex. The internal angle of a...

2019-09-25 19:32:40 183

原创 Keiichi Tsuchiya the Drift King (几何题)

题目:Drifting is a driving style in which the driver uses the throttle, brakes, clutch, gear shifting and steering input to keep the car in a state of oversteer while manoeuvring from turn to turn. As ...

2019-09-22 16:36:26 333

原创 Distance

题目:There are n points on a horizontal line, labelled with 1 through n from left to right.The distance between the i-th point and the (i+1)-th point is ai.For each integer k ranged from 1 to n, you ...

2019-09-22 16:06:17 212

原创 Kinds of Fuwas

题目:In the year 2008, the 29th Olympic Games will be held in Beijing. This will signify the prosperity of China as well as becoming a festival for people all over the world.The official mascots of Be...

2019-09-19 19:26:24 225

原创 Light bulbs

Light bulbs欢迎使用Markdown编辑器新的改变功能快捷键合理的创建标题,有助于目录的生成如何改变文本的样式插入链接与图片如何插入一段漂亮的代码片生成一个适合你的列表创建一个表格设定内容居中、居左、居右SmartyPants创建一个自定义列表如何创建一个注脚注释也是必不可少的KaTeX数学公式新的甘特图功能,丰富你的文章UML 图表FLowchart流程图导出与导入导出导入Light...

2019-09-18 23:13:59 214

空空如也

空空如也

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

TA关注的人

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