본문 바로가기

problem solving

Palindrome Numbers http://acm.pku.edu.cn/JudgeOnline/problem?id=2402 Description A palindrome is a word, number, or phrase that reads the same forwards as backwards. For example, the name "anna" is a palindrome. Numbers can also be palindromes (e.g. 151 or 753357). Additionally numbers can of course be ordered in size. The first few palindrome numbers are: 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 22, 33, ... The number 10 i.. 더보기
Sum of Factorials http://acm.pku.edu.cn/JudgeOnline/problem?id=1775 Description John von Neumann, b. Dec. 28, 1903, d. Feb. 8, 1957, was a Hungarian-American mathematician who made important contributions to the foundations of mathematics, logic, quantum physics,meteorology, science, computers, and game theory. He was noted for a phenomenal memory and the speed with which he absorbed ideas and solved problems. In.. 더보기
Crazy tea party http://acm.pku.edu.cn/JudgeOnline/problem?id=1455 Description n participants of > sit around the table. Each minute one pair of neighbors can change their places. Find the minimum time (in minutes) required for all participants to sit in reverse order (so that left neighbors would become right, and right - left). Input The first line is the amount of tests. Each next line contains one integer n (1 더보기
Prime Path http://acm.pku.edu.cn/JudgeOnline/problem?id=3126 Description The ministers of the cabinet were quite upset by the message from the Chief of Security stating that they would all have to change the four-digit room numbers on their offices. — It is a matter of security to change such things every now and then, to keep the enemy in the dark. — But look, I have chosen my number 1033 for good reasons.. 더보기
Ugly Number http://acm.pku.edu.cn/JudgeOnline/problem?id=1338 Description Ugly numbers are numbers whose only prime factors are 2, 3 or 5. The sequence 1, 2, 3, 4, 5, 6, 8, 9, 10, 12, ... shows the first 10 ugly numbers. By convention, 1 is included. Given the integer n,write a program to find and print the n'th ugly number. Input Each line of the input contains a postisive integer n (n 더보기
TopCoder SRM 420 http://www.topcoder.com/stat?c=round_overview&er=5&rd=13511 한국시간으로 10월 2일 오후 8시에 SRM420이 열렸다. 개인적으로 SRM 417 이후로 3주만에 참가하는 SRM이기도 하고 ACM-ICPC예선을 제외하곤 최근 알고리즘 문제풀이를 거의 한적이 없어 약간 긴장이 되었지만 크게 부담갖지 않고 했던것 같다. 한국인이 이렇게 많이 참가한 SRM은 개인적으로 처음!! 250 - SolitaireSimulation Problem Statement Consider the following solitaire game: We have a deck of identical cards. Initially, these cards are split into severa.. 더보기
Subsequence http://acm.pku.edu.cn/JudgeOnline/problem?id=3061 Description A sequence of N positive integers (10 < N < 100 000), each of them less than or equal 10000, and a positive integer S (S < 100 000 000) are given. Write a program to find the minimal length of the subsequence of consecutive elements of the sequence, the sum of which is greater than or equal to S. Input The first line is the number of .. 더보기
Center of symmetry http://acm.pku.edu.cn/JudgeOnline/problem?id=2526 Description Given is a set of n points with integer coordinates. Your task is to decide whether the set has a center of symmetry. A set of points S has the center of symmetry if there exists a point s (not necessarily in S) such that for every point p in S there exists a point q in S such that p-s = s-q. Input The first line of input contains a n.. 더보기
All in All http://acm.pku.edu.cn/JudgeOnline/problem?id=1936 Description You have devised a new encryption technique which encodes a message by inserting between its characters randomly generated strings in a clever way. Because of pending patent issues we will not discuss in detail how the strings are generated and inserted into the original message. To validate your method, however, it is necessary to wr.. 더보기
Risk http://acm.pku.edu.cn/JudgeOnline/problem?id=1603 Description Risk is a board game in which several opposing players attempt to conquer the world. The gameboard consists of a world map broken up into hypothetical countries. During a player's turn, armies stationed in one country are only allowed to attack only countries with which they share a common border. Upon conquest of that country, the ar.. 더보기