自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

codeswarrior的博客

学习心得和知识分享

  • 博客(734)
  • 收藏
  • 关注

原创 Computer HDU - 2196(树形DP)

Computer HDU - 2196A school bought the first computer some time ago(so this computer’s id is 1). During the recent years the school bought N-1 new computers. Each new computer was connected to one o...

2018-09-15 09:53:37 1028

原创 Puzzled Elena HDU - 5468(dfs序+容斥定理)

Puzzled Elena HDU - 5468 Since both Stefan and Damon fell in love with Elena, and it was really difficult for her to choose. Bonnie, her best friend, suggested her to throw a question to them, and s...

2018-09-14 19:56:12 268

原创 Stern-Brocot Tree HDU - 4556(法里数列长度)

Stern-Brocot Tree HDU - 4556 上图是一棵Stern-Brocot树,其生成规则如下:  从第1行到第n行,每行相邻两数a/b和c/d,产生中间数(a+c)/(b+d),置于下一行中。将一行的分数(包括0/1,1/0),进行约分简化,则每一行(包括0/1,1/0,1/1),不会出现两个相同的分数。若分子或者分母大于n,则去掉该分数,将剩下的分数,从小到大排序,得...

2018-09-14 15:54:46 430

原创 Pythagoras HDU - 6211(法里数列构造+本原勾股数组+本地预处理不出来。。)

Pythagoras HDU - 6211Given a list of integers a0,a1,a2,⋯,a2k−1. Pythagoras triples over 109 are all solutions of x2+y2=z2 where x,y and z are constrained to be positive integers less than or equal t...

2018-09-14 15:08:43 371

原创 Zuma HDU - 6212(区间dp)

Zuma HDU - 6212Think about the Zuma Game. You have a row of at most 200 black(0) or white(1) balls on the table at the start. Each three consecutive balls never share the same colour. You also ...

2018-09-14 09:44:45 296

原创 The Intersection HDU - 6209(二分分数+法里数列构造)

The Intersection HDU - 6209A given coefficient K leads an intersection of two curves f(x) and gK(x). In the first quadrant, the curve f is a monotone increasing function that f(x)=x−−√. The curve g ...

2018-09-14 05:38:45 253

原创 Brute Force Sorting HDU - 6215(模拟双向链表)

Brute Force Sorting HDU - 6215Beerus needs to sort an array of N integers. Algorithms are not Beerus’s strength. Destruction is what he excels. He can destroy all unsorted numbers in the array simul...

2018-09-14 04:50:48 240

原创 Apple HDU - 6206(JAVA高精度求三角形外心)

Apple HDU - 6206Apple is Taotao’s favourite fruit. In his backyard, there are three apple trees with coordinates (x1,y1), (x2,y2), and (x3,y3). Now Taotao is planning to plant a new one, but he is n...

2018-09-13 16:54:35 260

原创 Frequent values UVA - 11235(RMQ)

Frequent values UVA - 11235题意:给出一个非降序排列的数组,a1,a2,...,ana1,a2,...,ana_1,a_2,...,a_n,对于一系列询问[l,r][l,r][l,r]回答ai,ai+1,...,ajai,ai+1,...,aja_i,a_{i+1},...,a_j中出现次数最多的值所出现的的次数分析:因为是非降序的数组,因此相同的数字...

2018-09-11 20:35:00 133

原创 Caterpillar POJ - 3310(树的直径)

Caterpillar POJ - 3310An undirected graph is called a caterpillar if it is connected, has no cycles, and there is a path in the graph where every node is either on this path or a neighbor of a node ...

2018-09-11 17:58:13 277

原创 Cow Marathon POJ - 1985(树的直径模板题)

Cow Marathon POJ - 1985After hearing about the epidemic of obesity in the USA, Farmer John wants his cows to get more exercise, so he has committed to create a bovine marathon for his cows to run. T...

2018-09-11 11:40:57 292

原创 Ryuji doesn't want to study (树状数组)

Ryuji doesn’t want to study (树状数组)Ryuji is not a good student, and he doesn’t want to study. But there are n books he should learn, each book has its knowledge a[i]a[i]a[i].Unfortunately, the long...

2018-09-11 10:17:07 455

原创 2018ACM-ICPC徐州赛区网络赛: A. Hard to prepare(递推)

2018ACM-ICPC徐州赛区网络赛: A. Hard to prepare(递推)After Incident, a feast is usually held in Hakurei Shrine. This time Reimu asked Kokoro to deliver a Nogaku show during the feast. To enjoy the show, every...

2018-09-11 09:36:09 421

原创 ACM-ICPC 2018 徐州赛区网络预赛 - G Trace - 思维

ACM-ICPC 2018 徐州赛区网络预赛 - G Trace - 思维There’s a beach in the first quadrant. And from time to time, there are sea waves. A wave ( xxx , yyy ) means the wave is a rectangle whose vertexes are ( 000 , ...

2018-09-10 16:22:30 241

原创 ACM-ICPC 2018 沈阳赛区网络预赛D-Made In Heave(A*+SPFA求第K最短路)

ACM-ICPC 2018 沈阳赛区网络预赛(D-Made In Heaven)A*+SPFA求第K最短路One day in the jail, F·F invites Jolyne Kujo (JOJO in brief) to play tennis with her. However, Pucci the father somehow knows it and wants to sto...

2018-09-10 11:01:51 228

原创 ACM-ICPC 2018 沈阳赛区网络预赛 G.Spare Tire (容斥)

Spare TireA sequence of integer {an}\lbrace a_n \rbrace{an​} can be expressed as:an={0,n=02,n=13an−1−an−22+n+1,n>1\displaystyle a_n = \left{ 0,2,3an−1−an−22+n+1,n=0n=1n>10,n=02,n=13an−1−an−2...

2018-09-09 10:09:12 276 3

原创 Reading comprehension HDU - 4990(打表找递推式+矩阵快速幂)

Reading comprehension HDU - 4990 Read the program below carefully then answer the question.#pragma comment(linker, "/STACK:1024000000,1024000000")#include <cstdio>#include<iostream>#...

2018-09-08 09:33:51 204

原创 Jzzhu and Sequences CodeForces - 450B(矩阵快速幂)

Jzzhu and Sequences CodeForces - 450BJzzhu has invented a kind of sequences, they meet the following property: You are given x and y, please calculate fn modulo 1000000007 (109 + 7). Input...

2018-09-08 08:32:09 193

原创 Ellipsoid HDU - 5017(模拟退火)

Ellipsoid HDU - 5017 Given a 3-dimension ellipsoid(椭球面) your task is to find the minimal distance between the original point (0,0,0) and points on the ellipsoid. The distance between two poi...

2018-09-07 21:43:09 228

原创 233 Matrix HDU - 5015(矩阵快速幂)

233 Matrix HDU - 5015 In our daily life we often use 233 to express our feelings. Actually, we may say 2333, 23333, or 233333 ... in the same meaning. And here is the question: Suppose we have a mat...

2018-09-07 19:38:02 172

原创 Dice HDU - 5012(bfs)

Dice HDU - 5012 There are 2 special dices on the table. On each face of the dice, a distinct number was written. Consider a 1.a 2,a 3,a 4,a 5,a 6 to be numbers written on top face, bottom face, left...

2018-09-07 09:27:52 173

原创 Number Sequence HDU - 5014(思维构造)

Number Sequence HDU - 5014 There is a special number sequence which has n+1 integers. For each number in sequence, we have two rules:● a i ∈ [0,n]● a i ≠ a j( i ≠ j )For sequence a and sequence...

2018-09-07 09:11:24 265

原创 基础计算几何模板+解释

这个部分模板是来自kuagnbin模板,我为了能够好理解加了些解释和说明首先在开始前需要定义一些变量,和几个必要的方法#include <bits/stdc++.h>using namespace std;const double eps = 1e8;const double inf = 1e20;const double pi = acos( 1.0);//圆周率c...

2018-09-06 15:53:00 383

原创 Just Random HDU - 4790(数学+数形结合)

Just Random HDU - 4790 Coach Pang and Uncle Yang both love numbers. Every morning they play a game with number together. In each game the following will be done:  1. Coach Pang randomly choose a in...

2018-09-06 11:09:10 290

原创 Fibonacci Tree HDU - 4786(最小生成树Kruskal)

Fibonacci Tree HDU - 4786Coach Pang is interested in Fibonacci numbers while Uncle Yang wants him to do some research on Spanning Tree. So Coach Pang decides to solve the following problem:  Consid...

2018-09-06 09:46:37 216

原创 Codeforces 1017F The Neutral Zone(数论好题)

F. The Neutral Zonetime limit per test 5 seconds memory limit per test 16 megabytes input standard input output standard outputNotice: unusual memory limit!After the war, destroyed cities...

2018-09-05 07:22:12 260

原创 The Wu CodeForces - 1017D(状态压缩)

The Wu CodeForces - 1017DChildan is making up a legendary story and trying to sell his forgery — a necklace with a strong sense of “Wu” to the Kasouras. But Mr. Kasoura is challenging the truth of C...

2018-09-04 20:29:56 178

原创 The Phone Number CodeForces - 1017C(构造+思维)

The Phone Number CodeForces - 1017CMrs. Smith is trying to contact her husband, John Smith, but she forgot the secret phone number!The only thing Mrs. Smith remembered was that any permutation of ...

2018-09-04 19:57:32 361

原创 The Bits CodeForces - 1017B(思维)

The Bits CodeForces - 1017BRudolf is on his way to the castle. Before getting into the castle, the security staff asked him a question:Given two binary numbers a and b of length n. How many diffe...

2018-09-04 19:35:52 407

原创 Kingdom of Black and White HDU - 5583(思维)

Kingdom of Black and White HDU - 5583In the Kingdom of Black and White (KBW), there are two kinds of frogs: black frog and white frog.Now N frogs are standing in a line, some of them are blac...

2018-09-04 12:53:16 245

原创 Binary Tree HDU - 5573(构造+思维)

Binary Tree HDU - 5573The Old Frog King lives on the root of an infinite tree. According to the law, each node should connect to exactly two nodes on the next level, forming a full binary tree.Sin...

2018-09-04 12:45:54 362

原创 LCM Walk HDU - 5584(数论+思维)

LCM Walk HDU - 5584A 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 num...

2018-09-04 10:15:55 574

原创 Looking for Order (状压DP)

Looking for OrderGirl Lena likes it when everything is in order, and looks for order everywhere. Once she was getting ready for the University and noticed that the room was in a mess — all the objec...

2018-09-04 09:41:53 398

原创 Find a way HDU - 2612(两起点bfs)

Find a way HDU - 2612 Pass a year learning in Hangzhou, yifenfei arrival hometown Ningbo at finally. Leave Ningbo one year, yifenfei have many people to meet. Especially a good friend Merceki.Yifen...

2018-09-04 07:51:50 377

原创 Oil Deposits HDU - 1241(BFS找连通分量)

Oil Deposits HDU - 1241 The GeoSurvComp geologic survey company is responsible for detecting underground oil deposits. GeoSurvComp works with one large rectangular region of land at a time, and crea...

2018-09-03 16:38:18 222

原创 棋盘问题 POJ - 1321(DFS)

棋盘问题 POJ - 1321在一个给定形状的棋盘(形状可能是不规则的)上面摆放棋子,棋子没有区别。要求摆放时任意的两个棋子不能放在棋盘中的同一行或者同一列,请编程求解对于给定形状和大小的棋盘,摆放k个棋子的所有可行的摆放方案C。 Input 输入含有多组测试数据。 每组数据的第一行是两个正整数,n k,用一个空格隔开,表示了将在一个n*n的矩阵内描述棋盘,以及摆放棋...

2018-09-03 16:14:48 259

原创 Did you mean...(模拟+条件判断)

Did you mean…Beroffice text editor has a wide range of features that help working with text. One of the features is an automatic search for typos and suggestions of how to fix them.Beroffice works...

2018-09-03 15:19:58 5551

原创 Roman Digits(打表找规律)

Roman DigitsLet’s introduce a number system which is based on a roman digits. There are digits I, V, X, L which correspond to the numbers 1, 5, 10 and 50respectively. The use of other roman digits...

2018-09-03 14:13:09 635

原创 病毒侵袭 HDU - 2896(AC自动机数组模拟指针)

病毒侵袭 HDU - 2896 当太阳的光辉逐渐被月亮遮蔽,世界失去了光明,大地迎来最黑暗的时刻。。。。在这样的时刻,人们却异常兴奋——我们能在有生之年看到500年一遇的世界奇观,那是多么幸福的事儿啊~~但网路上总有那么些网站,开始借着民众的好奇心,打着介绍日食的旗号,大肆传播病毒。小t不幸成为受害者之一。小t如此生气,他决定要把世界上所有带病毒的网站都找出来。当然,谁都知道这是不可能的。小...

2018-09-03 12:45:36 150

原创 Keywords Search HDU - 2222(AC自动机模板)

Keywords Search HDU - 2222 In the modern time, Search engine came into the life of everybody like Google, Baidu, etc.Wiskey also wants to bring this feature to his image retrieval system.Every ima...

2018-09-03 10:20:57 148

空空如也

空空如也

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

TA关注的人

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