- 博客(26)
- 资源 (2)
- 收藏
- 关注
原创 codeforces A.Vacations
Vasya hasndays of vacations! So he decided to improve his IT skills and do sport. Vasya knows the following information about each of thisndays: whether that gym opened and whether a contest was
2016-08-31 23:55:42 298
原创 codeforces C.Coloring Trees
ZS the Coder and Chris the Baboon has arrived at Udayland! They walked in the park wherentrees grow. They decided to be naughty and color the trees in the park. The trees are numbered with integer
2016-08-31 20:24:43 542
原创 codeforces 687A - NP-Hard Problem(dfs
Recently, Pari and Arya did some research about NP-Hard problems and they found theminimum vertex coverproblem very interesting.Suppose the graphGis given. SubsetAof its vertices is called
2016-08-26 11:15:19 413
原创 codeforces Codeforces Round #363 (Div. 2) One Bomb
You are given a description of a depot. It is a rectangular checkered field ofn × msize. Each cell in a field can be empty (".") or it can be occupied by a wall ("*").You have one bomb. If you
2016-08-25 16:08:48 303
原创 codeforces AIM Tech Round 3 (Div. 2) B. Checkpoints
Vasya takes part in the orienteering competition. There arencheckpoints located along the line at coordinatesx1, x2, ..., xn. Vasya starts at the point with coordinatea. His goal is to visit at
2016-08-25 13:18:30 560
原创 codeforces 687C - The Values You Can Make(背包+滚动数组)
Pari wants to buy an expensive chocolate from Arya. She has n coins, the value of the i-th coin is ci. The price of the chocolate is k, so Pari will take a subset of her coins with sum equal to k and
2016-08-25 11:17:50 614
原创 codeforces 710D Two Arithmetic Progressions
You are given two arithmetic progressions:a1k + b1anda2l + b2. Find the number of integersxsuch thatL ≤ x ≤ Randx = a1k' + b1 = a2l' + b2, for some integersk', l' ≥ 0.InputThe
2016-08-24 01:17:32 612
原创 codeforces 710C Magic Odd Square
Find ann × nmatrix with different numbers from1ton2, so the sum in each row, column and both main diagonals are odd.InputThe only line contains odd integern(1 ≤ n ≤ 49).Ou
2016-08-23 00:34:04 586
原创 Codeforces Round #365 (Div. 2) D. Mishka and Interesting sum(精简的代码)
Little Mishka enjoys programming. Since her birthday has just passed, her friends decided to present her with array of non-negative integersa1, a2, ..., anofnelements!Mishka loved the array an
2016-08-22 17:35:24 447
原创 codeforces 689A Mike and Cellphone(模拟)
While swimming at the beach, Mike has accidentally dropped his cellphone into the water. There was no worry as he bought a cheap replacement phone with an old-fashioned keyboard. The keyboard has only
2016-08-22 15:43:58 358
原创 codeforces 681C Heap Operations
Petya has recently learned data structure named "Binary heap".The heap he is now operating with allows the following operations:put the given number into the heap;get the value of the mini
2016-08-21 22:07:28 389
原创 codeforces 701C They Are Everywhere(尺取法)
Sergei B., the young coach of Pokemons, has found the big house which consists ofnflats ordered in a row from left to right. It is possible to enter each flat from the street. It is possible to go
2016-08-21 14:31:13 477
原创 codeforces 707C Pythagorean Triples
Katya studies in a fifth grade. Recently her class studied right triangles and the Pythagorean theorem. It appeared, that there are triples of positive integers such that you can construct a right tri
2016-08-21 11:02:18 448
原创 codeforces 707B - Bakery
Masha wants to open her own bakery and bake muffins in one of thencities numbered from1ton. There arembidirectional roads, each of whose connects some pair of cities.To bake muffins in he
2016-08-21 09:25:18 415
原创 codeforces 702C Cellular Network
You are givennpoints on the straight line — the positions (x-coordinates) of the cities andmpoints on the same line — the positions (x-coordinates) of the cellular towers. All towers work in t
2016-08-20 20:20:58 479
原创 codeforces 702B - Powers of Two
You are givennintegersa1, a2, ..., an. Find the number of pairs of indexesi, j(i j) thatai + ajis a power of2(i. e. some integerxexists so thatai + aj = 2x).InputThe fir
2016-08-20 20:16:40 414
原创 Codeforces Round #367 (Div. 2) D Vasiliy Multiset(查找树)
Author has gone out of the stories about Vasiliy, so here is just a formal task description.You are givenqqueries and a multisetA, initially containing only integer0. There are three types o
2016-08-19 15:52:29 451
原创 codeforces 706C Hard problem
Vasiliy is fond of solving different tasks. Today he found one he wasn't able to solve himself, so he asks you to help.Vasiliy is givennstrings consisting of lowercase English letters. He wants
2016-08-19 08:57:58 467
原创 FOJ 1018 Maximal Sum(三维子矩最大和)
Problem 1018 Maximal Sum Accept: 339Submit: 904Time Limit: 1000 mSecMemory Limit : 32768 KB Problem DescriptionGiven a cube of positive and negative integers, find the sub-cube
2016-08-16 11:14:42 504
原创 FOJ Playing with Calculator (模运算)
Problem DescriptionPete is playing a game. He types on a calculator a natural number K and then presses the '+' key. The display still shows K. Pete wants to have on the display a number that is f
2016-08-15 22:12:51 379
原创 FOJ 1033 URLs(水题)
Problem DescriptionIn the early nineties, the World Wide Web (WWW) was invented. Nowadays, most people think that the WWW simply consists of all the pretty (or not so pretty) HTML-pages that you c
2016-08-14 23:30:05 647
原创 FOJ 2110 Star
Problem DescriptionOverpower often go to the playground with classmates. They play and chat on the playground. One day, there are a lot of stars in the sky. Suddenly, one of Overpower’s classmates a
2016-08-14 09:43:00 363
原创 FOJ 1012 Relatives(欧拉值)
Problem DescriptionGiven n, a positive integer, how many positive integers less than n are relatively prime to n? Two integers a and b are relatively prime if there are no integersx > 1, y > 0
2016-08-13 19:38:23 429
原创 FOJ 2200 cleaning(环形dp)
Problem 2200 cleaning Problem DescriptionN个人围成一圈在讨论大扫除的事情,需要选出K个人。但是每个人与他距离为2的人存在矛盾,所以这K个人中任意两个人的距离不能为2,他们想知道共有多少种方法。 Input第一行包含一个数T(T接下来每行有两个数N,K,N表示人数,K表示需要的人数(1 Output输出满足
2016-08-13 16:00:20 520
原创 FOJ 1096 QS Network (最小生成树kruskal)
Problem DescriptionIn the planet w-503 of galaxy cgb, there is a kind of intelligent creature named QS. QScommunicate with each other via networks. If two QS want to get connected, they need to buy
2016-08-04 14:57:48 336
原创 POJ3278 Catch That Cow(最短路+bfs)
DescriptionFarmer John has been informed of the location of a fugitive cow and wants to catch her immediately. He starts at a point N (0 ≤ N ≤ 100,000) on a number line and the cow is at a point K (
2016-08-01 16:03:13 304
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人