自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

芒果街上的小屋(此博客暂时停用)

温故而知新,可以为师矣。

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

原创 【codechef】Lazy Players

Concerned with the fitness levels of the players in the National Team, the coach decides to carry out a running drill in the next training session. So, he sets up checkpoints in the training ground at

2015-04-30 22:03:59 459

原创 【codechef】 Zeroes(大数灵活题)

Virat loves mathematical questions. The other day he came across an interesting question which required him to find out the number of trailing zeroes for thefunction. F(n) = 11*22......NN,where N is

2015-04-30 17:48:32 457

原创 zoj 3879 Capture the Flag(长模拟)

In computer security, Capture the Flag (CTF) is a computer security competition. CTF contests are usually designed to serve as an educational exercise to give participants experience in securing a mac

2015-04-29 21:58:37 662

原创 zoj 3870 Team Formation(位运算,超时)

For an upcoming programming contest, Edward, the headmaster of Marjar University, is forming a two-man team from Nstudents of his university.Edward knows the skill level of each student. He has fo

2015-04-29 18:27:16 417

原创 zoj3872 Beauty of Array(dp)

Edward has an array A with N integers. He defines the beauty of an array as the summation of all distinct integers in the array. Now Edward wants to know the summation of the beauty of all contiguous

2015-04-29 10:29:20 512

原创 【codechef】一维王国问题(最少需要几颗炸弹)

N one dimensional kingdoms are represented as intervals of the form [ai , bi] on the real line.A kingdom of the form [L, R] can be destroyed completely by placing a bomb at a point x on the real lin

2015-04-24 13:49:29 1443

原创 zoj 3485 Identification Number身份证(模拟)

Mr. Wu, the inspector of the district, is really angry for a robbery happened last night. The robber escaped while Mr. Wu knows nothing about him. The only clue Mr. Wu has is a photo of the robber, wh

2015-04-23 18:08:10 708

原创 zoj 2836 Number Puzzle(容斥,求1到m有多少个数能被数组里任意一个整除)

Given a list of integers (A1, A2, ..., An), and a positive integer M, please find the number of positive integers that are not greater than M and dividable by any integer from the given list.Input

2015-04-23 12:55:32 542

原创 【codechef】Jovians from Jupiter(父亲和孩子不能同时上船)

Jovians, the citizens of Jupiter, have a very long life, and all the Jovians are a part of one family. Since they have a very long life, in order to control population, all the Jovians are allowed t

2015-04-21 19:40:38 385

原创 【codechef】Gcd Queries(灵活题,分类)

#include#include#include#include#include#include#include#include#include#define ll long longusing namespace std;int x[100001]; //把memset删掉就不超时了。。。int y[100001];int gcd(int a,int b){

2015-04-21 18:50:07 479

原创 zoj 2967 Colorful Rainbows求不被覆盖的直线数(贪心)

Evelyn likes drawing very much. Today, she draws lots of rainbows on white paper of infinite size, each using a different color. Since there're too many rainbows now, she wonders, how many of them can

2015-04-21 18:19:25 719

原创 zoj 2968 Difference Game (模拟)

Now you are going to play an interesting game. In this game, you are given two groups of distinct integers and C coins. The two groups, named Ga and Gb respectively, are not empty and contain the sa

2015-04-21 13:15:16 624

原创 zoj 3781 Paint the Grid Reloaded (最短路,连通块缩点)

Leo has a grid with N rows and M columns. All cells are painted with either black or white initially.Two cells A and B are called connected if they share an edge and they are in the same color, or

2015-04-21 13:14:07 1024

原创 【codechef】Sereja and Votes(模拟)

Sereja conducted a voting about N of his opinions. Ai percent of people voted for opinion number i.This statistics is called valid if sum of all Ai is equal to 100.Now let us define rounding up

2015-04-21 11:27:34 908

原创 【编程之美2015资格赛】基站选址(数学题)

需要在一个N × M的网格中建立一个通讯基站,通讯基站仅必须建立在格点上。网格中有A个用户,每个用户的通讯代价是用户到基站欧几里得距离的平方。网格中还有B个通讯公司,维护基站的代价是基站到最近的一个通讯公司的路程(路程定义为曼哈顿距离)。在网格中建立基站的总代价是用户通讯代价的总和加上维护基站的代价,最小总代价。输入第一行为一个整数T,表示数据组数。每组数据第一行为四个

2015-04-21 08:47:05 733

原创 zoj 2852 Deck of Cards扑克牌(三维dp)

21-point is a small game played with cards. Its aim is to accumulate the points on the cards so as to get 21 points. This game also appears on some cell phones.To simplify the problem, let's have

2015-04-19 21:27:22 726

原创 【codechef】Kisses(dp,技巧题)

Mohit and his girlfriend are playing a game named 'Ascending sort'. The norms of the game are as follows :Initialy N integers are taken randomly and are kept on the table. The one who makes these

2015-04-19 18:54:05 568

原创 zoj 2975 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 Bei

2015-04-18 22:21:39 459

原创 zoj 1180 Self Numbers(大数,灵活题)

In 1949 the Indian mathematician D.R. Kaprekar discovered a class of numbers called self-numbers. For any positive integer n, define d(n) to be n plus the sum of the digits of n. (The d stands for d

2015-04-18 17:42:47 626

原创 【编程之美挑战赛】回文字符序列(区间dp)

给定字符串,求它的回文子序列个数。回文子序列反转字符顺序后仍然与原序列相同。例如字符串aba中,回文子序列为"a", "a", "aa", "b", "aba",共5个。内容相同位置不同的子序列算不同的子序列。输入第一行一个整数T,表示数据组数。之后是T组数据,每组数据为一行字符串。输出对于每组数据输出一行,格式为"Case #X: Y",X代表数据编号(从1开始)

2015-04-18 15:38:22 454

原创 有关【年、月、日】的函数

int judge(int year){if((year%4==0&&year%100!=0)||(year%400==0))return 1;elsereturn 0;}int yearsum(int year){return year/4-year/100+year/400;}

2015-04-18 14:42:14 679

原创 zoj 3204 2966 Connect them|建设电力系统(最小生成树)

You have n computers numbered from 1 to n and you want to connect them to make a small local area network (LAN). All connections are two-way (that is connecting computers i and j is the same as connec

2015-04-18 11:48:26 1104

原创 zoj 3780 Paint the Grid Again(拓扑排序)

Leo has a grid with N × N cells. He wants to paint each cell with a specific color (either black or white).Leo has a magical brush which can paint any row with black color, or any column with whit

2015-04-16 23:03:45 451

原创 zoj 3778 Talented Chef(简单,灵活题)

As we all know, Coach Gao is a talented chef, because he is able to cook M dishes in the same time. Tonight he is going to have a hearty dinner with his girlfriend at his home. Of course, Coach Gao is

2015-04-16 23:00:31 526

原创 hznu 1652 能量项链(dp,难)

在Mars星球上,每个Mars人都随身佩带着一串能量项链。在项链上有 N颗能量珠。能量珠是一颗有头标记与尾标记的珠子,这些标记对应着某个正整数。并且,对于相邻的两颗珠子,前一颗珠子的尾标记一定等于后一颗珠子的头标 记。因为只有这样,通过吸盘(吸盘是Mars人吸收能量的一种器官)的作用,这两颗珠子才能聚合成一颗珠子,同时释放出可以被吸盘吸收的能量。如果前一颗 能量珠的头标记为m,尾标记为r,后一颗能

2015-04-16 22:46:04 477

原创 zoj 3601 Unrequited Love(STL,灵活题)

There are n single boys and m single girls. Each of them may love none, one or several of other people unrequitedly and one-sidedly. For the coming q days, each night some of them will come together t

2015-04-16 22:33:10 850

原创 zoj 3784 String of Infinity(难题,方法妙)

Given a set of banned words S, please find out whether it is possible to construct a string str1..∞ with infinite length that fulfills the following constrains:It consists of only the first M type

2015-04-16 20:31:31 869

原创 zoj 3782 Ternary Calculation(简单题,但有陷阱)

Complete the ternary calculation.InputThere are multiple test cases. The first line of input contains an integer T indicating the number of test cases. For each test case:There is a string

2015-04-16 20:26:01 431

原创 zoj 3785 What day is that day?(找规律,KMP)

It's Saturday today, what day is it after 11 + 22 + 33 + ... + NN days?InputThere are multiple test cases. The first line of input contains an integer T indicating the number of test cases. Fo

2015-04-16 19:44:25 518

原创 zoj 3480 Duck Typing(模拟,分类讨论,读题)

If it looks like a duck, swims like a duck, and quacks like a duck, then it probably is a duck.When I see a bird that walks like a duck and swims like a duck and quacks like a duck, I call that bird

2015-04-16 18:28:41 520

原创 zoj 1734 Power Network(最大流模板)

A power network consists of nodes (power stations, consumers and dispatchers) connected by power transport lines. A node u may be supplied with an amount s(u) >= 0 of power, may produce an amount 0 <=

2015-04-16 18:20:29 569

原创 zoj 3331 Process the Tasks(双塔DP)

There are two machines A and B. There are n tasks, namely task 1, task 2, ..., task n. You must assign each task to one machine to process it. There are some facts you must know and comply with:Yo

2015-04-16 15:40:38 736

原创 zoj 3177 Elune's Arrow(数学题,分类讨论)

Priestess of the Moon (PotM) is a very interesting hero in the game Defense of the Ancients (DotA). Here is the official description of PotM:"A matriarch and high priestess of Elune's blessed orde

2015-04-16 15:01:26 913

原创 【codechef】Chef and A Large Permutation(技巧题)

Today is Chef's birthday. His mom gifted him a truly lovable gift, a permutation of first N positive integers.She placed the permutation on a very long table in front of Chef and left it for him t

2015-04-16 11:49:07 779

原创 zoj 3862 Intersection (技巧题)

Edward has 2n points on the plane conveniently labeled with 1,2,…,2n. Each point is connected exactly with another point by a segment.Edward finds that some segments intersecting with some others.

2015-04-15 23:39:44 525

原创 zoj 3868 GCD Expectation(容斥原理)

Edward has a set of n integers {a1, a2,...,an}. He randomly picks a nonempty subset {x1, x2,…,xm} (each nonempty subset has equal probability to be picked), and would like to know the expectation of

2015-04-15 17:09:24 508

原创 zoj 3647 Gao the Grid (求三角形的个数,困难)

A n * m grid as follow:Count the number of triangles, three of whose vertice must be grid-points.Note that the three vertice of the triangle must not be in a line(the right picture is not a

2015-04-15 16:04:25 755

原创 【codechef】Towers(比较难想到方法的模拟题)

There are N towers in a city. All N towers are placed in a single row.Score of tower i is the the number of towers visible to its right side.Tower j will be visible to Tower i if it satisfies the

2015-04-15 12:32:48 475

原创 【codechef】Yet Another Problem On Strings (找最优解)

You are given a string X consisting of lowercase alphabets. You are required to generate the largest stringY from X by following the given instructions below:frequency(Y[i]) in X >= frequency(Y[j]

2015-04-14 11:00:05 585

原创 【codechef】 Chef and Piano Scales (简单题)

Recently, Chef got obsessed with piano. He is a just a rookie in this stuff and can not move his fingers from one key to other fast enough. He discovered that the best way to train finger speed is to

2015-04-14 09:02:07 713

考研数学公式概念大全

考研数学公式概念大全 。

2018-08-15

空空如也

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

TA关注的人

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