
CodeForces
ccq1n
TongjiU 2022级大三
展开
-
HDOJ 5463-Clarke and minecraft【贪心】
Clarke and minecraftTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 888 Accepted Submission(s): 445Problem DescriptionClarke原创 2016-04-24 17:22:03 · 398 阅读 · 0 评论 -
CodeForces 367A-Sereja and Algorithm【规律】
Sereja loves all sorts of algorithms. He has recently come up with a new algorithm, which receives a string as an input. Let's represent the input string of the algorithm as q = q1q2... qk. The algorithm consists of two steps:Find any continuous subsequen原创 2016-03-15 17:43:42 · 335 阅读 · 0 评论 -
♥codeforces 627A-XOR Equation【数学】
Two positive integers a and b have a sum of s and a bitwise XOR of x. How many possible values are there for the ordered pair (a, b)?原创 2016-03-15 16:28:41 · 1048 阅读 · 0 评论 -
CodeForces 597A-Divisibility【数学】
Find the number of k-divisible numbers on the segment [a, b]. In other words you need to find the number of such integer values x that a ≤ x ≤ b and x is divisible by k.原创 2016-03-14 18:55:51 · 537 阅读 · 0 评论 -
CodeForces 618A-Slime Combining【模拟】
Your friend recently gave you some slimes for your birthday. You have n slimes all initially with value 1.You are going to play a game with these slimes. Initially, you put a single slime by itself in a row. Then, you will add the othern - 1 slimes one by原创 2016-03-14 18:32:42 · 362 阅读 · 0 评论 -
CodeForces 622A-Infinite Sequence
Consider the infinite sequence of integers: 1, 1, 2, 1, 2, 3, 1, 2, 3, 4, 1, 2, 3, 4, 5.... The sequence is built in the following way: at first the number 1 is written out, then the numbers from 1 to 2, then the numbers from 1 to 3, then the numbers from原创 2016-03-14 18:03:57 · 341 阅读 · 0 评论 -
CodeForces 598A- Tricky Sum
In this problem you are to calculate the sum of all integers from 1 to n, but you should take all powers of two with minus in the sum.For example, for n = 4 the sum is equal to - 1 - 2 + 3 - 4 = - 4, because 1, 2 and 4 are 20, 21 and 22 respectively.Ca原创 2016-03-14 17:23:20 · 373 阅读 · 0 评论 -
CodeForces 596A-Wilbur and Swimming Pool
After making bad dives into swimming pools, Wilbur wants to build a swimming pool in the shape of a rectangle in his backyard. He has set up coordinate axes, and he wants the sides of the rectangle to be parallel to them. Of course, the area of the rectang原创 2016-03-14 17:04:12 · 504 阅读 · 0 评论 -
CodeForces 630G-Challenge Pennants【组合数学】
Because of budget cuts one IT company established new non-financial reward system instead of bonuses.Two kinds of actions are rewarded: fixing critical bugs and suggesting new interesting features. A man who fixed a critical bug gets "I fixed a critical原创 2016-03-14 16:40:16 · 817 阅读 · 0 评论 -
CodeForces 618B-Guess the Permutation【搜索】
Bob has a permutation of integers from 1 to n. Denote this permutation as p. The i-th element of p will be denoted as pi. For all pairs of distinct integers i, j between 1 and n, he wrote the number ai, j = min(pi, pj). He writes ai, i = 0 for all integer原创 2016-04-05 17:28:58 · 332 阅读 · 0 评论 -
CodeForces 630N-Forecast
The Department of economic development of IT City created a model of city development till year 2100.To prepare report about growth perspectives it is required to get growth estimates from the model.To get the growth estimates it is required to solve a原创 2016-03-10 20:58:04 · 635 阅读 · 0 评论 -
CodeForces 630K-Indivisibility【容斥定理】
IT City company developing computer games decided to upgrade its way to reward its employees. Now it looks the following way. After a new game release users start buying it actively, and the company tracks the number of sales with precision to each transac原创 2016-03-10 20:26:24 · 433 阅读 · 0 评论 -
CodeForces 630J-Divisibility【最小公倍数】
IT City company developing computer games invented a new way to reward its employees. After a new game release users start buying it actively, and the company tracks the number of sales with precision to each transaction. Every time when the next number of原创 2016-03-10 11:56:54 · 534 阅读 · 0 评论 -
Codeforces 660C-Hard Process【尺取法经典练习】
C. Hard Processtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given an array a with n elements.原创 2016-05-03 11:58:52 · 1399 阅读 · 1 评论 -
Codeforces 630L-L. Cracking the Code【整数快速幂】
L. Cracking the Codetime limit per test0.5 secondsmemory limit per test64 megabytesinputstandard inputoutputstandard outputThe protection of a popular program d原创 2016-05-03 12:36:06 · 367 阅读 · 0 评论 -
CodeForces 1A-Theatre Square【数学】
Theatre Square in the capital city of Berland has a rectangular shape with the size n × m meters. On the occasion of the city's anniversary, a decision was taken to pave the Square with square granite flagstones. Each flagstone is of the size a × a.What原创 2016-04-24 17:11:24 · 517 阅读 · 0 评论 -
CodeForces 407A-Triangle【模拟】
A. Triangletime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputThere is a right triangle with legs of length a原创 2016-05-19 13:49:10 · 842 阅读 · 0 评论 -
CodeForces 552B-Vanya and Books
B. Vanya and Bookstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputVanya got an important task — he should e原创 2016-04-21 20:34:38 · 815 阅读 · 0 评论 -
CodeForces 552C-Vanya and Scales【思维】
C. Vanya and Scalestime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputVanya has a scales for weighing loads an原创 2016-04-21 20:31:07 · 580 阅读 · 0 评论 -
CodeForces 552D-Vanya and Triangles【计算整数三点能否组成三角形】
D. Vanya and Trianglestime limit per test4 secondsmemory limit per test512 megabytesinputstandard inputoutputstandard outputVanya got bored and he painted n dis原创 2016-04-21 20:14:19 · 731 阅读 · 0 评论 -
CodeForces 552A-Vanya and Table【模拟】
Vanya has a table consisting of 100 rows, each row contains 100 cells. The rows are numbered by integers from 1 to 100 from bottom to top, the columns are numbered from 1 to 100 from left to right.In this table, Vanya chose n rectangles with sides that g原创 2016-04-21 20:10:00 · 303 阅读 · 0 评论 -
CodeForces 557B-Pasha and Tea【模拟】
Pasha decided to invite his friends to a tea party. For that occasion, he has a large teapot with the capacity of w milliliters and 2n tea cups, each cup is for one of Pasha's friends. The i-th cup can hold at most ai milliliters of water.It turned out t原创 2016-04-21 20:07:30 · 464 阅读 · 0 评论 -
CodeForces 557A-Ilya and Diplomas【模拟】
Soon a school Olympiad in Informatics will be held in Berland, n schoolchildren will participate there.At a meeting of the jury of the Olympiad it was decided that each of the n participants, depending on the results, will get a diploma of the first, sec原创 2016-04-21 20:04:37 · 326 阅读 · 0 评论 -
CodeForces 554A-Kyoya and Photobooks【规律】
Kyoya Ootori is selling photobooks of the Ouran High School Host Club. He has 26 photos, labeled "a" to "z", and he has compiled them into a photo booklet with some photos in some order (possibly with some photos being duplicated). A photo booklet can be d原创 2016-04-21 19:53:54 · 551 阅读 · 0 评论 -
CodeForces 554B. Ohana Cleans Up【思维】
Ohana Matsumae is trying to clean a room, which is divided up into an n by n grid of squares. Each square is initially either clean or dirty. Ohana can sweep her broom over columns of the grid. Her broom is very strange: if she sweeps over a clean square,原创 2016-04-21 19:43:47 · 327 阅读 · 0 评论 -
Codeforces 246A-Buggy Sorting【模拟】
A. Buggy Sortingtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputLittle boy Valera studies an algorithm of原创 2016-05-03 19:28:07 · 335 阅读 · 0 评论 -
Codeforces 246B-Increase and Decrease【模拟】
B. Increase and Decreasetime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputPolycarpus has an array, consistin原创 2016-05-03 18:54:50 · 533 阅读 · 0 评论 -
CodeForces 621A-Wet Shark and Odd and Even
Today, Wet Shark is given n integers. Using any of these integers no more than once, Wet Shark wants to get maximum possible even (divisible by 2) sum. Please, calculate this value for Wet Shark.Note, that if Wet Shark uses no integers from the n integers原创 2016-03-10 11:27:20 · 475 阅读 · 0 评论 -
CodeForces 630F-Selection of Personnel【组合数学】
One company of IT City decided to create a group of innovative developments consisting from 5 to 7 people and hire new employees for it. After placing an advertisment the company received n resumes. Now the HR department has to evaluate each possible group原创 2016-03-09 21:22:28 · 358 阅读 · 0 评论 -
CodeForces 630E-A rectangle
Developing tools for creation of locations maps for turn-based fights in a new game, Petya faced the following problem.A field map consists of hexagonal cells. Since locations sizes are going to be big, a game designer wants to have a tool for quick fill原创 2016-03-09 14:01:38 · 403 阅读 · 0 评论 -
CodeForces-630C. Lucky Numbers
The numbers of all offices in the new building of the Tax Office of IT City will have lucky numbers.Lucky number is a number that consists of digits 7 and 8 only. Find the maximum number of offices in the new building of the Tax Office given that a door-p原创 2016-02-20 10:40:39 · 538 阅读 · 0 评论 -
CodeForces-630A. Again Twenty Five!【找规律】
The HR manager was disappointed again. The last applicant failed the interview the same way as 24 previous ones. "Do I give such a hard task?" — the HR manager thought. "Just raise number 5 to the power of n and get last two digits of the number. Yes, of c原创 2016-02-20 09:03:22 · 674 阅读 · 2 评论 -
CodeForces 626B-Cards【DFS】
Catherine has a deck of n cards, each of which is either red, green, or blue. As long as there are at least two cards left, she can do one of two actions:take any two (not necessarily adjacent) cards with different colors and exchange them for a new card原创 2016-03-06 14:09:44 · 403 阅读 · 0 评论 -
CodeForces 598D-Igor In the Museum【DFS】
Igor is in the museum and he wants to see as many pictures as possible.Museum can be represented as a rectangular field of n × m cells. Each cell is either empty or impassable. Empty cells are marked with '.', impassable cells are marked with '*'. Every t原创 2016-03-06 14:02:11 · 547 阅读 · 0 评论 -
CodeForces 151A - Soft Drinking
This winter is so cold in Nvodsk! A group of n friends decided to buy k bottles of a soft drink called "Take-It-Light" to warm up a bit. Each bottle has l milliliters of the drink. Also they bought c limes and cut each of them into d slices. After that the原创 2016-03-05 14:36:50 · 999 阅读 · 0 评论 -
CodeForces 631A-Interview
Blake is a CEO of a large company called "Blake Technologies". He loves his company very much and he thinks that his company should be the best. That is why every candidate needs to pass through the interview that consists of the following problem.We defi原创 2016-03-04 15:55:02 · 443 阅读 · 0 评论 -
CodeForces 630R-Game
There is a legend in the IT City college. A student that failed to answer all questions on the game theory exam is given one more chance by his professor. The student has to play a game with the professor.The game is played on a square field consisting of原创 2016-03-04 14:45:39 · 523 阅读 · 0 评论 -
CodeForces 526A-King of Thieves
Let's call a level to be good if you can perform a sequence of four jumps of the same length or in the other words there must be a sequence i1, i2, ..., i5, consisting of five platforms so that the intervals between consecutive platforms are of the same le原创 2016-03-15 20:59:24 · 489 阅读 · 0 评论 -
CodeForces 526A-Voting for Photos【模拟】
After celebrating the midcourse the students of one of the faculties of the Berland State University decided to conduct a vote for the best photo. They published the photos in the social network and agreed on the rules to choose a winner: the photo which g原创 2016-03-15 19:31:12 · 631 阅读 · 0 评论 -
♥CodeForces 609B-B. The Best Gift【组合数学】
Emily's birthday is next week and Jack has decided to buy a present for her. He knows she loves books so he goes to the local bookshop, where there are n books on sale from one of m genres.In the bookshop, Jack decides to buy two books of different genres原创 2016-01-13 14:45:44 · 548 阅读 · 0 评论