自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

里弗杰克

新博客地址:yecj.me

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

原创 CodeForces 340D - Bubble Sort Graph

Iahub recently has learned Bubble Sort, an algorithm that is used tosort a permutation with n elements a1, a2, ..., an in ascending order. He is bored of this so simple algorithm, so heinvents his

2015-07-29 00:36:03 964

原创 CodeForces 343B - Alternating Current

原文(有图):http://codeforces.com/problemset/problem/343/BMad scientist Mike has just finished constructing a new device to searchfor extraterrestrial intelligence! He was in such a hurry to launch it fo

2015-07-29 00:24:43 838

原创 CodeForces 270B - Multithreading

Emuskald is addicted to Codeforces, and keeps refreshing the main pagenot to miss any changes in the "recent actions" list. He likes toread thread conversations where each thread consists of multiple

2015-07-29 00:19:55 696

原创 CodeForces 349B - Color the Fence

Igor has fallen in love with Tanya. Now Igor wants to show his feelingsand write a number on the fence opposite to Tanya's house. Igor thinks that thelarger the number is, the more chance to win Tanya

2015-07-29 00:14:36 808

原创 CodeForces 18C - Stripe

Once Bob took a paper stripe of n squares (the height of the stripe is 1 square). In each square he wrotean integer number, possibly negative. He became interested in how many waysexist to cut this

2015-07-29 00:09:17 442

原创 CodeForces 5C - Longest Regular Bracket Sequence

This is yet another problem dealing with regular bracket sequences.We should remind you that a bracket sequence is called regular, if byinserting«+» and«1» into it we can get a correct mathemati

2015-07-29 00:07:04 382

原创 CodeForces 140C - New Year Snowmen

As meticulous Gerald sets the table and caring Alexander sends thepostcards, Sergey makes snowmen. Each showman should consist of threesnowballs: a big one, a medium one and a small one. Sergey's twin

2015-07-29 00:01:23 1019

原创 Gym 100513M - Variable Shadowing

In computer programming, variable shadowing occurs when a variable declared within a certain scope has the same nameas a variable declared in an outer scope. The outer variable is said to beshadowed

2015-07-28 23:53:14 902

原创 Gym 100513I - Sale in GameStore

A well-known Berland onlinegames store has announced a great sale! Buy any game today, and you candownload more games for free! The only constraint is that the total price ofthe games downloaded for f

2015-07-28 23:48:41 574

原创 Gym 100513F - Ilya Muromets

Ilya Muromets is alegendary bogatyr. Right now he is struggling against Zmej Gorynych, a dragonwith n headsnumbered from 1 to n from left to right.Making one sweep of swordIlya Muromets can cut at

2015-07-28 23:46:55 986

原创 Gym 100513D - Data Center

The startup"Booble" has shown explosive growth and now it needs a new datacenter with the capacity of m petabytes. Booble canbuy servers, there are n servers available forpurchase: they have equal p

2015-07-28 23:41:43 482

原创 CodeForces 366B - Dima and To-do List

You helped Dima to have a great weekend, but it's time to work.Naturally, Dima, as all other men who have girlfriends, does everything wrong.Inna and Dima are now in one room. Inna tells Dima off fo

2015-07-28 23:36:51 633

原创 CodeForces 366A - Dima and Guards

Nothing has changed since the last round. Dima and Inna still love eachother and want to be together. They've made a deal with Seryozha and now theyneed to make a deal with the dorm guards...There a

2015-07-27 13:07:15 637

原创 CodeForces 363D - Renting Bikes

A group of n schoolboys decided to ride bikes. As nobody ofthem has a bike, the boys need to rent them.The renting site offered them m bikes. The renting price is different for different bikes,

2015-07-27 12:57:17 499

原创 CodeForces 362A - Two Semiknights Meet

A boy Petya loves chess very much. He even came up with a chess piece ofhis own, a semiknight. The semiknight can move in any of these four directions: 2 squares forward and 2 squares to the right, 

2015-07-27 12:48:17 457

原创 Gym 100187M - Heaviside Function

Heaviside function is defined as the piecewiseconstant function whose value is zero for negative argument and one fornon-negative argument:You are given the function f(x) = θ(s1x - a1) + θ(s2x - a2)

2015-07-27 12:42:45 888

原创 Gym 100187L - Ministry of Truth

Andrey works in the Ministry of Truth. His work is changing articles innewspapers and magazines so that they praise the Party and Big Brother.Recently Big Brother decided that it would be fine if al

2015-07-27 12:34:55 720

原创 Gym 100187H - Mysterious Photos

Everyone probably heard the rumours about the constellation of BermudaTriangle: any person who looks to this constellation of three stars is said todisappear completely. Though, it's not clear who the

2015-07-27 12:31:17 642

原创 Gym 100187E - Two Labyrinths

A labyrinth is the rectangular grid, each of the cellsof which is either free or wall, and it's possible to move only between freecells sharing a side.Constantine and Mike are the world leaders ofco

2015-07-27 12:28:32 704

原创 Gym 100187B - A Lot of Joy

Two boys Gena and Petya wrote on two strips of paper the same string s that consisted of lowercase Latin letters. Theneach boy took one strip, cut it into small pieces so that each piece containedex

2015-07-27 12:25:04 837

原创 Gym 100187A - Potion of Immortality

The world famous scientist Innokentiy has just synthesized the potion ofimmortality. Unfortunately, he put the flask with this potion on the shelfwhere most dangerous poisons of all time were kept. No

2015-07-27 11:18:54 1309

原创 HDU 4287 - Intelligent IME

Problem Description  We all use cell phone today. And we must be familiarwith the intelligent English input method on the cell phone. To be specific,the number buttons may correspond to some English

2015-07-27 11:11:59 359

原创 HDU 4278 - Faulty Odometer

Problem Description  You are given a car odometer which displays the milestraveled as an integer. The odometer has a defect, however: it proceeds fromthe digit 2 to the digit 4 and from the digit 7

2015-07-27 11:09:41 352

原创 CodeForces 469C - 24 Game

Little X used to play a card game called "24 Game", butrecently he has found it too easy. So he invented a new game.Initially you have a sequence of n integers: 1, 2, ..., n. In a single step, you

2015-07-27 11:06:01 628

原创 CodeForces 463C - Gargari and Bishops

Gargari is jealous that his friend Caisa won the game from the previousproblem. He wants to prove that he is a genius.He has a n × n chessboard. Each cell of the chessboard has a number written on

2015-07-27 11:00:35 491

原创 HDU 5099 - Comparison of Android versions

Problem DescriptionAs an Android developer, itˇs really not easy to figure out a newer version of twokernels, because Android is updated so frequently and has many branches.Fortunately, Google ident

2015-07-27 10:51:19 342

原创 HDU 5095 - Linearization of the kernel functions in SVM

Problem DescriptionSVM(Support Vector Machine)is an importantclassification tool, which has a wide range of applications in clusteranalysis, community division and so on. SVM The kernel functions us

2015-07-27 10:49:42 419

原创 HDU 5090 - Game with Pearls

Problem DescriptionTom and Jerry are playing a game with tubes andpearls. The rule of the game is:1) Tom and Jerry come up together with a number K. 2) Tom provides N tubes. Within each tube

2015-07-27 10:45:46 360

原创 CodeForces 363C - Fixing Typos

Many modern text editors automatically check the spelling of the user'stext. Some editors even suggest how to correct typos.In this problem your task to implement a small functionality to correcttwo

2015-07-27 10:40:50 724

原创 CodeForces 363B - Fence

There is a fence in front of Polycarpus's home. The fence consists of n planks of the same width which go one afteranother from left to right. The height of the i-th plank is hi meters, distinct p

2015-07-27 10:37:16 1094

原创 CodeForces 363A - Soroban

You know that Japan is the country with almost the largest 'electronicdevices per person' ratio. So you might be quite surprised to find out that theprimary school in Japan teaches to count using a 

2015-07-27 10:29:43 486

原创 UVA 10285 - Longest Run on a Snowboard

解题思路:一开始想到的就是dfs+记忆化。做完之后发现还有dp的方法。Dp即按高度从小到大排,然后从小的点开始,每次判断dp[tx][ty]=max(dp[tx][ty],dp[x][y]+1); //(tx,ty)是当前点(x,y)相邻四个方向的点 代码(dfs):#define _CRT_SECURE_NO_WARNINGS#include #include #i

2015-07-27 10:23:22 334

空空如也

空空如也

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

TA关注的人

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