自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

博客

acm菜鸟

  • 博客(113)
  • 资源 (1)
  • 收藏
  • 关注

原创 AtCoder Regular Contest 101 C - Candles

Problem Statement There are N candles placed on a number line. The i-th candle from the left is placed on coordinate xi. Here, x1#include <bits/stdc++.h>#define inf 0x3f3f3f3fusing namespa...

2018-08-27 21:13:53 390 1

原创 D - AtCoder Express 2(dp,类似区间求线段个数)

Problem Statement In Takahashi Kingdom, there is a east-west railroad and N cities along it, numbered 1, 2, 3, …, N from west to east. A company called AtCoder Express possesses M trains, and the tra...

2018-08-19 19:50:51 315

原创 D - Candy Distribution Beginner Contest 105(子序列和是m的倍数的个数)

Problem Statement There are N boxes arranged in a row from left to right. The i-th box from the left contains Ai candies.You will take out the candies from some consecutive boxes and distribute the...

2018-08-12 21:12:21 404

原创 E.room(二分图最大权匹配KM算法)

题目描述 Nowcoder University has 4n students and n dormitories ( Four students per dormitory). Students numbered from 1 to 4n.And in the first year, the i-th dormitory ‘s students are (x1[i],x2[i],x3[...

2018-08-03 15:06:39 220

原创 A gpa(0-1分数规划)

题目描述 Kanade selected n courses in the university. The academic credit of the i-th course is s[i] and the score of the i-th course is c[i]. At the university where she attended, the final score of h...

2018-08-03 14:05:34 324

原创 C Shuffle Cards(rope 平衡树)

链接:https://www.nowcoder.com/acm/contest/141/C 来源:牛客网题目描述 Eddy likes to play cards game since there are always lots of randomness in the game. For most of the cards game, the very first step in th...

2018-07-27 15:05:23 162

原创 1019 逆序数 (归并排序 线段树)

1019 逆序数 基准时间限制:1 秒 空间限制:131072 KB 分值: 0 难度:基础题 收藏 关注 在一个排列中,如果一对数的前后位置与大小顺序相反,即前面的数大于后面的数,那么它们就称为一个逆序。一个排列中逆序的总数就称为这个排列的逆序数。 如2 4 3 1中,2 1,4 3,4 1,3 1是逆序,逆序数是4。给出一个整数序列,求该序列的逆序数。 Input第1行:N,N...

2018-07-20 17:29:14 188

原创 Goldbach (米勒罗宾素数判断)

Description:Goldbach’s conjecture is one of the oldest and best-known unsolved problems in number theory and all of mathematics. It states:Every even integer greater than 2 can be expressed as the...

2018-04-23 17:23:40 647

原创 hdu 1358 Period (KMP求循环节)

Period For each prefix of a given string S with N characters (each character has an ASCII code between 97 and 126, inclusive), we want to know whether the prefix is a periodic string. That is, for ea...

2018-04-21 17:00:59 115

原创 51nod 1069 Nim游戏(博弈论)

有N堆石子。A B两个人轮流拿,A先拿。每次只能从一堆中取若干个,可将一堆全取走,但不可不取,拿到最后1颗石子的人获胜。假设A B都非常聪明,拿石子的过程中不会出现失误。给出N及每堆石子的数量,问最后谁能赢得比赛。 例如:3堆石子,每堆1颗。A拿1颗,B拿1颗,此时还剩1堆,所以A可以拿到最后1颗石子。 Input 第1行:一个数N,表示有N堆石子。(1 <= N <= 1000...

2018-03-26 17:14:02 146

原创 51nod 1459 迷宫游戏(Dijkstra)

1459 迷宫游戏 基准时间限制:1 秒 空间限制:131072 KB 分值: 0 难度:基础题 收藏 关注 你来到一个迷宫前。该迷宫由若干个房间组成,每个房间都有一个得分,第一次进入这个房间,你就可以得到这个分数。还有若干双向道路连结这些房间,你沿着这些道路从一个房间走到另外一个房间需要一些时间。游戏规定了你的起点和终点房间,你首要目标是从起点尽快到达终点,在满足首要目标的前提下,使得你的...

2018-03-20 21:31:21 168

原创 1058 N的阶乘的长度(斯特林公式)

1058 N的阶乘的长度 基准时间限制:1 秒 空间限制:131072 KB 分值: 0 难度:基础题 收藏 关注 输入N求N的阶乘的10进制表示的长度。例如6! = 720,长度为3。 Input 输入N(1 <= N <= 10^6) Output 输出N的阶乘的长度 Input示例 6 Output示例 3斯特林公式:n!=sqrt(2*pi*n)*(n...

2018-03-19 22:05:54 192

原创 51nod 1007 正整数分组(dp)

1007 正整数分组 基准时间限制:1 秒 空间限制:131072 KB 分值: 10 难度:2级算法题 收藏 关注 将一堆正整数分为2组,要求2组的和相差最小。 例如:1 2 3 4 5,将1 2 4分为1组,3 5分为1组,两组和相差1,是所有方案中相差最少的。 Input 第1行:一个数N,N为正整数的数量。 第2 - N+1行,N个正整数。 (N <= 100, 所有...

2018-03-19 11:53:08 137

原创 C - 2D Plane 2N Points(二分图匹配 匈牙利算法)

C - 2D Plane 2N Points Time limit : 2sec / Memory limit : 256MBScore : 400 pointsProblem Statement On a two-dimensional plane, there are N red points and N blue points. The coordinates of the i-...

2018-03-19 10:41:27 378

原创 1049 最大子段和

N个整数组成的序列a[1],a[2],a[3],…,a[n],求该序列如a[i]+a[i+1]+…+a[j]的连续子段和的最大值。当所给的整数均为负数时和为0。 例如:-2,11,-4,13,-5,-2,和最大的子段为:11,-4,13。和为20。 Input 第1行:整数序列的长度N(2 <= N <= 50000) 第2 - N + 1行:N个整数(-10^9 <= A[i] <= 10

2017-12-27 13:26:08 161

原创 唐纳德与子串 (Easy)(计算子串个数)

Time limit per test: 1.0 seconds Memory limit: 256 megabytes 子串的定义是在一个字符串中连续出现的一段字符。这里,我们使用 s[l…r] 来表示 s 字符串从 l 到 r(闭区间)的子串。在本题中,字符串下标从 0 开始。显然,对于长度为 n 的字符串共有 n(n+1)2 个子串。 对于一个给定的字符串 s,唐纳德给出 q 次询问,第

2017-12-08 22:21:07 664

原创 list的简单应用

Lists将元素按顺序储存在链表中. 与 向量(vectors)相比, 它允许快速的插入和删除,但是随机访问却比较慢.assign() 给list赋值 back() 返回最后一个元素 begin() 返回指向第一个元素的迭代器 clear() 删除所有元素 empty() 如果list是空的则返回true end() 返回末尾的迭代器 erase() 删除一个元素 fro

2017-10-13 13:53:05 898

原创 Round #435 (Div. 2)B. Mahmoud and Ehab and the bipartiteness(二分图染色)

Mahmoud and Ehab continue their adventures! As everybody in the evil land knows, Dr. Evil likes bipartite graphs, especially trees.A tree is a connected acyclic graph. A bipartite graph is a graph, who

2017-09-21 22:04:28 443

原创 hdu-6214 Smallest Minimum Cut(最小割的最少边)

Problem Description Consider 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

2017-09-21 16:10:07 216

原创 hdu 6216-A Cubic number and A Cubic Number

Problem Description A cubic number is the result of using a whole number in a multiplication three times. For example, 3×3×3=27 so 27 is a cubic number. The first few cubic numbers are 1,8,27,64 and 1

2017-09-18 20:23:40 519 1

原创 hdu 6213-Chinese Zodiac (map)

Problem Description The Chinese Zodiac, known as Sheng Xiao, is based on a twelve-year cycle, each year in the cycle related to an animal sign. These signs are the rat, ox, tiger, rabbit, dragon, snak

2017-09-18 17:54:47 528

原创 D - How Many Answers Are Wrong HDU - 3038(带权并查集)

TT and FF are … friends. Uh… very very good friends -__-b FF is a bad boy, he is always wooing TT to play the following game with him. This is a very humdrum game. To begin with, TT should write down a

2017-09-14 22:07:54 213

原创 POJ - 1182 食物链(并查集)

动物王国中有三类动物A,B,C,这三类动物的食物链构成了有趣的环形。A吃B, B吃C,C吃A。 现有N个动物,以1-N编号。每个动物都是A,B,C中的一种,但是我们并不知道它到底是哪一种。 有人用两种说法对这N个动物所构成的食物链关系进行描述: 第一种说法是”1 X Y”,表示X和Y是同类。 第二种说法是”2 X Y”,表示X吃Y。 此人对N个动物,用上述两种说法,一句接一句地说出

2017-09-14 22:04:51 138

原创 POJ - 1511 Invitation Cards(spfa)

In the age of television, not many people attend theater performances. Antique Comedians of Malidinesia are aware of this fact. They want to propagate theater and, most of all, Antique Comedies. They h

2017-09-14 14:53:57 167

原创 hdu-6197 array array array(最长上升子序列(LIS)长度的O(nlogn)算法)

Problem Description One day, Kaitou Kiddo had stolen a priceless diamond ring. But detective Conan blocked Kiddo’s path to escape from the museum. But Kiddo didn’t want to give it back. So, Kiddo aske

2017-09-12 19:57:47 184

原创 hdu-6198number number number

Problem Description We define a sequence F:⋅ F0=0,F1=1; ⋅ Fn=Fn−1+Fn−2 (n≥2).Give you an integer k, if a positive number n can be expressed by n=Fa1+Fa2+…+Fak where 0≤a1≤a2≤⋯≤ak, this positive numbe

2017-09-12 19:41:11 263

原创 hdu-6195 cable cable cable

Problem Description Connecting the display screen and signal sources which produce different color signals by cables, then the display screen can show the color of the signal source.Notice that every

2017-09-12 19:26:48 152

原创 D - joisino's travel(最短路+排序)

Problem Statement There are N towns in the State of Atcoder, connected by M bidirectional roads.The i-th road connects Town Ai and Bi and has a length of Ci.Joisino is visiting R towns in the state, r

2017-09-09 22:39:22 409

原创 I - Arbitrage POJ - 2240

Arbitrage is the use of discrepancies in currency exchange rates to transform one unit of a currency into more than one unit of the same currency. For example, suppose that 1 US Dollar buys 0.5 British

2017-09-09 10:53:34 159

原创 POJ - 1502 MPI Maelstrom

BIT has recently taken delivery of their new supercomputer, a 32 processor Apollo Odyssey distributed shared memory machine with a hierarchical communication subsystem. Valentine McKee’s research advis

2017-09-08 20:56:36 146

原创 POJ - 3259 Wormholes

While exploring his many farms, Farmer John has discovered a number of amazing wormholes. A wormhole is very peculiar because it is a one-way path that delivers you to its destination at a time that is

2017-09-08 15:27:58 166

原创 POJ - 3660 Cow Contest

N (1 ≤ N ≤ 100) cows, conveniently numbered 1..N, are participating in a programming contest. As we all know, some cows code better than others. Each cow has a certain constant skill rating that is uni

2017-09-08 11:46:10 137

原创 POJ - 2253 Frogger

Freddy Frog is sitting on a stone in the middle of a lake. Suddenly he notices Fiona Frog who is sitting on another stone. He plans to visit her, but since the water is dirty and full of tourists’ suns

2017-09-08 10:33:52 185

原创 POJ - 3268 Silver Cow Party

One cow from each of N farms (1 ≤ N ≤ 1000) conveniently numbered 1..N is going to attend the big cow party to be held at farm #X (1 ≤ X ≤ N). A total of M (1 ≤ M ≤ 100,000) unidirectional (one-way roa

2017-09-07 21:44:11 169

原创 POJ - 1797 Heavy Transportation

Background Hugo Heavy is happy. After the breakdown of the Cargolifter project he can now expand business. But he needs a clever man who tells him whether there really is a way from the place his cus

2017-09-07 16:53:41 148

原创 POJ - 2387 Til the Cows Come Home

Bessie is out in the field and wants to get back to the barn to get as much sleep as possible before Farmer John wakes her for the morning milking. Bessie needs her beauty sleep, so she wants to get ba

2017-09-07 16:47:11 135

原创 POJ - 3126 Prime Path

The ministers of the cabinet were quite upset by the message from the Chief of Security stating that they would all have to change the four-digit room numbers on their offices. — It is a matter of se

2017-09-06 19:44:23 263

原创 UVA - 11624 Fire!

Joe works in a maze. Unfortunately, portions of the maze have caught on fire, and the owner of the maze neglected to create a fire escape plan. Help Joe escape the maze. Given Joe’s location in the

2017-09-06 19:35:51 127

原创 POJ - 1426 Find The Multiple

Given a positive integer n, write a program to find out a nonzero multiple m of n whose decimal representation contains only the digits 0 and 1. You may assume that n is not greater than 200 and there

2017-09-05 20:21:47 152

原创 POJ - 2251 Dungeon Master

You are trapped in a 3D dungeon and need to find the quickest way out! The dungeon is composed of unit cubes which may or may not be filled with rock. It takes one minute to move one unit north, south,

2017-09-05 18:14:28 196

kuangbin的ACM模板

kuangbin的ACM模板kuangbin的ACM模板kuangbin的ACM模板kuangbin的ACM模板kuangbin的ACM模板kuangbin的ACM模板

2017-09-17

空空如也

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

TA关注的人

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