04 2017 档案
摘要:Description Mike has a sequence A = [a1, a2, ..., an] of length n. He considers the sequence B = [b1, b2, ..., bn] beautiful if the gcd of all its ele
阅读全文
摘要:Description Mike has n strings s1, s2, ..., sn each consisting of lowercase English letters. In one move he can choose a string si, erase the first ch
阅读全文
摘要:Description Mike has a string s consisting of only lowercase English letters. He wants to change exactly one character from the string so that the res
阅读全文
摘要:Description Petya recieved a gift of a string s with length up to 105 characters for his birthday. He took two more empty strings t and u and decided
阅读全文
摘要:Description You are given sequence a1, a2, ..., an of integer numbers of length n. Your task is to find such subsequence that its sum is odd and maxim
阅读全文
摘要:Description Given a positive integer n, find k integers (not necessary distinct) such that all these integers are strictly greater than 1, and their p
阅读全文
摘要:In computer science, the Knuth-Morris-Pratt string searching algorithm (or KMP algorithm) searches for occurrences of a "word" W within a main "text s
阅读全文
摘要:Marjar Cola is on sale now! In order to attract more customers, Edward, the boss of Marjar Company, decides to launch a promotion: If a customer retur
阅读全文
摘要:A - ι⊥l Time limit : 2sec / Memory limit : 256MB Score : 100 points Problem Statement Three poles stand evenly spaced along a line. Their heights are
阅读全文
摘要:Description Inzane finally found Zane with a lot of money to spare, so they together decided to establish a country of their own. Ruling a country is
阅读全文
摘要:Description Although Inzane successfully found his beloved bone, Zane, his owner, has yet to return. To search for Zane, he would need a lot of money,
阅读全文
摘要:Description Zane the wizard is going to perform a magic show shuffling the cups. There are n cups, numbered from 1 to n, placed along the x-axis on a
阅读全文
摘要:Description Zane the wizard had never loved anyone before, until he fell in love with a girl, whose name remains unknown to us. The girl lives in hous
阅读全文
摘要:Description Bear Limak prepares problems for a programming competition. Of course, it would be unprofessional to mention the sponsor name in the state
阅读全文
摘要:Description A tree is an undirected connected graph without cycles. The distance between two vertices is the number of edges in a simple path between
阅读全文
摘要:Description In the army, it isn't easy to form a group of soldiers that will be effective on the battlefield. The communication is crucial and thus no
阅读全文
摘要:Description Bear Limak examines a social network. Its main functionality is that two members can become friends (then they can talk with each other an
阅读全文
摘要:Description Bear Limak wants to become the largest of bears, or at least to become larger than his brother Bob. Right now, Limak and Bob weigh a and b
阅读全文
摘要:B - Splatter Painting Time limit : 2sec / Memory limit : 256MB Score : 700 points Problem Statement Squid loves painting vertices in graphs. There is
阅读全文
摘要:A - AtCoder Group Contest Time limit : 2sec / Memory limit : 256MB Score : 300 points Problem Statement There are 3N participants in AtCoder Group Con
阅读全文
摘要:Description You are developing a new feature for the website which sells airline tickets: being able to sort tickets by price! You have already extrac
阅读全文
摘要:Description Input The input consists of four lines, each line containing a single digit 0 or 1. Output Output a single digit, 0 or 1. Example input 01
阅读全文
摘要:Description Input The only line of the input contains a string of digits. The length of the string is between 1 and 10, inclusive. Input The only line
阅读全文
摘要:Description DO YOU EXPECT ME TO FIND THIS OUT? WHAT BASE AND/XOR LANGUAGE INCLUDES string? DON'T BYTE OF MORE THAN YOU CAN CHEW YOU CAN ONLY DISTORT T
阅读全文
摘要:Description Programmers' kids solve this riddle in 5-10 minutes. How fast can you do it? Programmers' kids solve this riddle in 5-10 minutes. How fast
阅读全文
摘要:Description Input The input contains a single integer a (1 ≤ a ≤ 30). Description Input The input contains a single integer a (1 ≤ a ≤ 30). Output Out
阅读全文