自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

海绵的博客

竞赛虐我千百遍,我待竞赛如初恋。 Never Give Up!!!

  • 博客(40)
  • 问答 (8)
  • 收藏
  • 关注

原创 Scapegoat Gym - 101775B 思维题

Aori is very careless so she is always making troubles. One day she does it again, with N big troubles! But this time she seems to be at ease because she has found M Inklings to take all the blames. E...

2018-09-30 20:39:43 503

原创 Straight Master Gym - 101775J (差分)

A straight is a poker hand containing five cards of sequential rank, not necessarily to be the same suit. For example, a hand containing 7 club, 6 spade, 5 spade, 4 heart and 3 diamond forms a straigh...

2018-09-30 18:44:17 471

原创 SOS Gym - 101775L (找规律)

Mr. Panda and Mr. Sheep are playing a game on a 1 × N game board. Initially, all the cells are empty. Mr. Panda and Mr. Sheep take alternate moves and Mr.Panda moves first.On each move, a player mus...

2018-09-30 15:39:04 600

原创 Wrestling Match HDU - 5971 (推理)

Nowadays, 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 referee of the wrestling m...

2018-09-30 12:05:14 199

原创 Traffic Light Gym - 101775C

One year ago, Mr. Ang joined a great company and he rented a house on the same street as the company. The company is so great that Mr. Ang doesn't need to punch in and out. He can have a good sleep an...

2018-09-29 20:33:39 561

原创 Garden of Eden

When God made the first man, he put him on a beautiful garden, the Garden of Eden. Here Adam lived with all animals. God gave Adam eternal life. But Adam was lonely in the garden, so God made Eve. Whe...

2018-09-27 16:51:30 948

原创 Little Zu Chongzhi's Triangles HDU - 5135 (海伦公式 状压dp)

Zu Chongzhi (429–500) was a prominent Chinese mathematician and astronomer during the Liu Song and Southern Qi Dynasties. Zu calculated the value ofπ to the precision of six decimal places and for a t...

2018-09-27 13:15:04 216

原创 The E-pang Palace HDU - 5128 (判断两个矩形的关系)

E-pang Palace was built in Qin dynasty by Emperor Qin Shihuang in Xianyang, Shanxi Province. It was the largest palace ever built by human. It was so large and so magnificent that after many years of ...

2018-09-27 12:36:28 267

原创 Game of Taking Stones HDU - 5973 (二分)开根号

Two people face two piles of stones and make a game. They take turns to take stones. As game rules, there are two different methods of taking stones: One scheme is that you can take any number of ston...

2018-09-25 18:19:29 250

原创 【模板】高斯消元法

#include<bits/stdc++.h>using namespace std;//#define MOD 100000007#define eps 1e-9const int N=110;/*高斯消元模板 浮点数下标从1开始,按照增广矩阵的形式计算答案就是计算后增广矩阵中 最后一列*/double a[N][N];int n;int Guas...

2018-09-25 15:08:02 98

原创 辛普森积分法

很多函数的积分没有封闭形式,不能直接求解,所以我们可以计算近似解。 对于可以积分的,尽量积分,速度和准确度肯定是更高的。const double EPS=1e-8;double f(double x){ //写要求辛普森积分的函数,必须是 Y=f(x) 的形式 return ;}double simpson(double L, double R){ //三点辛...

2018-09-25 11:28:53 6949

原创 #1830 : Cheat

时间限制:1000ms单点时限:1000ms内存限制:256MB描述Cheat is a card game played by four players sitting around a table. They are numbered from 1 to 4 in clockwise order.A pack of 52 cards is used. There are 1...

2018-09-23 18:51:23 170

原创 Skr(马拉车+哈希)

A number is skr, if and only if it's unchanged after being reversed. For example, "12321", "11" and "1" are skr numbers, but "123", "221" are not. FYW has a string of numbers, each substring can prese...

2018-09-22 21:17:42 355

原创 #1829 : Tomb Raider(哈希)

描述Lara Croft, the fiercely independent daughter of a missing adventurer, must push herself beyond her limits when she discovers the island where her father disappeared. In this mysterious island, La...

2018-09-22 21:15:50 257

原创 transaction transaction transaction HDU - 6201

Kelukin is a businessman. Every day, he travels around cities to do some business. On August 17th, in memory of a great man, citizens will read a book named "the Man Who Changed China". Of course, Kel...

2018-09-21 15:47:42 163

原创 输入挂

重型武器:(调试之后,再换成read(),print())   大量输入的时候,绝对好用//直接读取文件,高级版,但是不能直接输入,只能文件来搞namespace fastIO {#define BUF_SIZE 100000 //fread -> read bool IOerror = 0; inline char nc() { //FILE* fp=fopen("12...

2018-09-21 14:15:06 188

原创 Red Black Tree ZOJ Problem Set - 4048

BaoBao has just found a rooted tree with vertices and weighted edges in his backyard. Among the vertices, of them are red, while the others are black. The root of the tree is vertex 1 and it's a red v...

2018-09-21 13:50:35 236

转载 Clone HDU - 5000 (Dilworth定理)

After eating food from Chernobyl, DRD got a super power: he could clone himself right now! He used this power for several times. He found out that this power was not as perfect as he wanted. For examp...

2018-09-19 10:50:49 138

原创 Walk HDU - 5001

I used to think I could be anything, but now I know that I couldn't do anything. So I started traveling.The nation looks like a connected bidirectional graph, and I am randomly walking on it. It mean...

2018-09-18 16:45:35 149

原创 String and Times

Now you have a string consists of uppercase letters, two integers AAA and BBB. We call a substring wonderful substring when the times it appears in that string is between AAA and BBB (A≤times≤BA \le t...

2018-09-16 21:01:42 297

原创 xor序列 (线性基)

链接:https://www.nowcoder.com/acm/contest/180/D来源:牛客网 题目描述小a有n个数,他提出了一个很有意思的问题:他想知道对于任意的x, y,能否将x与这n个数中的任意多个数异或任意多次后变为y 输入描述:第一行为一个整数n,表示元素个数第二行一行包含n个整数,分别代表序列中的元素第三行为一个整数Q,表示询问次数接下来Q行,每...

2018-09-15 21:18:44 211

原创 Participate in E-sports (开根号)

Jessie and Justin want to participate in e-sports. E-sports contain many games, but they don't know which one to choose, so they use a way to make decisions.They have several boxes of candies, and t...

2018-09-15 19:41:36 602

原创 城市规划

链接:https://www.nowcoder.com/acm/contest/180/C来源:牛客网 题目描述小a的国家里有n个城市,其中第i和第i - 1个城市之间有无向道路连接,特殊的,第1个城市仅与第2个城市相连为了减轻道路维护负担,城市规划局局长MXT给出了m个要求,他想让小a断开一些道路,使得任意1 ≤ i ≤ m ,城市xi不能到达城市yi同时最小化断开道路的数量...

2018-09-15 10:47:12 310

原创 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 she would choose the one who...

2018-09-14 20:29:34 207

转载 Zuma HDU - 6212

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

2018-09-14 14:43:07 216

原创 Brute Force Sorting HDU - 6215

Beerus 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 simultaneously. A number A[i] of the ...

2018-09-14 13:01:05 182

转载 Smallest Minimum Cut hdu-6214

Problem DescriptionConsider a network G=(V,E) with source s and sink t. An s-t cut is a partition of nodes set V into two parts such that s and t belong to different parts. The cut set is the subset...

2018-09-13 11:25:11 188

原创 #1387 : A Research on "The Hundred Family Surnames"

描述The Hundred Family Surnames is a classic Chinese text composed of common Chinese surnames. The book was composed in the early Song Dynasty. It originally contained 411 surnames, and was later expa...

2018-09-12 17:02:53 230 1

转载 Periodic Signal HihoCoder - 1388 (NTT)FFT

Profess X is an expert in signal processing. He has a device which can send a particular 1 second signal repeatedly. The signal is A0 ... An-1 under n Hz sampling.One day, the device fell on the gro...

2018-09-11 21:58:53 148

原创 Sewage Treatment HihoCoder - 1389 (二分+网络流+剪枝) SAP

After years of suffering, people could not tolerate the pollution in the city any more, and started a long-lasting protest. Eventually, the municipal government made up its mind to deal with the sewag...

2018-09-11 18:59:17 163

原创 BE, GE or NE (PN 结点)

In a world where ordinary people cannot reach, a boy named "Koutarou" and a girl named "Sena" are playing a video game. The game system of this video game is quite unique: in the process of playing th...

2018-09-10 17:13:27 493

原创 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 audience has to wear a Nogaku mask, and seat...

2018-09-10 11:05:50 500

原创 Ellipsoid(模拟退火算法) 主要是数据范围

Problem DescriptionGiven 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 points (x...

2018-09-09 19:07:03 1015

原创 Boring String Problem

Problem DescriptionIn this problem, you are given a string s and q queries.For each query, you should answer that when all distinct substrings of string s were sorted lexicographically, which one i...

2018-09-08 21:21:23 263

原创 Paint Pearls HDU - 5009 (dp+链表优化)

Lee has a string of n pearls. In the beginning, all the pearls have no color. He plans to color the pearls to make it more fascinating. He drew his ideal pattern of the string on a paper and asks for ...

2018-09-07 19:59:08 181

原创 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 matrix called 233 matrix. I...

2018-09-07 10:43:00 165

原创 E. Trips

There are npersons who initially don't know each other. On each morning, two of them, who were not friends before, become friends.We want to plan a trip for every evening of mdays. On each trip,...

2018-09-07 09:34:10 414

原创 D. Valid BFS?

The BFS algorithm is defined as follows.Consider an undirected graph with vertices numbered from 1to n. Initialize q as a new queue containing only vertex 1, mark the vertex 1as used. Extract a ...

2018-09-06 14:53:43 343

原创 游戏 (SG函数)

链接:https://www.nowcoder.com/acm/contest/161/B来源:牛客网 题目描述小N和小O在玩游戏。他们面前放了n堆石子,第i堆石子一开始有ci颗石头。他们轮流从某堆石子中取石子,不能不取。最后无法操作的人就输了这个游戏。但他们觉得这样玩太无聊了,更新了一下规则。具体是这样的:对于一堆有恰好m颗石子的石头堆,假如一个人要从这堆石子中取石子,设他要取石子数...

2018-09-04 19:47:25 243

原创 Different Integers

链接:https://www.nowcoder.com/acm/contest/139/J来源:牛客网 题目描述Given a sequence of integers a1, a2, ..., an and q pairs of integers (l1, r1), (l2, r2), ..., (lq, rq), find count(l1, r1), count(l2, r2),...

2018-09-01 10:41:02 166

空空如也

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

TA关注的人

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