2015ACM-ICPC长春E题(hdu5531)题解】的更多相关文章

一.题意 No response.T_T 二.思路 分$n$为奇数或者偶数讨论. 如果$n$是奇数,列出不等式组:$r_1+r_2=d_{1},r_2+r_3=d_{2},r_3+r_4=d_{3},\cdots,r_{n-1}+r_n=d_{n-1},r_n+r_1=d_n$,可以解出,$r_1=\frac{d_{1}+d_{3}+d_{5}+\cdots-d_{2}-d_{4}-\cdots}{2}$,然后再用上述式子依次算出$r_2$至$r_n$.最后判断$r_1$至$r_n$中是否存在负…
链接在这:http://bak.vjudge.net/contest/132442#overview. A题,给出a,b和n,初始的集合中有a和b,每次都可以从集合中选择不同的两个,相加或者相减,得到一个新的数,如果在1~n内的话就放入集合中,并算一次操作,谁先不能操作(所有新数已经存在于集合内的话就不能进行操作)者输.问谁会赢. 可以得到的数字为k*gcd(a,b),那么只要算出在1~n的范围内存在多少个这样的数字,判断一下奇偶性即可. B题,给出n个字符串,问最大的满足条件的字符串的位置,条…
House Building Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 262144/262144 K (Java/Others)Total Submission(s): 145    Accepted Submission(s): 123 Problem Description Have you ever played the video game Minecraft? This game has been one of t…
Count a * b Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 262144/262144 K (Java/Others)Total Submission(s): 211    Accepted Submission(s): 116 Problem Description Marry likes to count the number of ways to choose two non-negative integers a…
题目链接 http://acm.hdu.edu.cn/showproblem.php?pid=5558 Problem Description Alice wants to send a classified message to Bob. She tries to encrypt the message with her original encryption method. The message is a string S, which consists of Nlowercase let…
Chip Factory Time Limit: 18000/9000 MS (Java/Others)    Memory Limit: 262144/262144 K (Java/Others)Total Submission(s): 368    Accepted Submission(s): 202 Problem Description John is a manager of a CPU chip factory, the factory produces lots of chips…
Partial Tree Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 262144/262144 K (Java/Others)Total Submission(s): 228    Accepted Submission(s): 138 Problem Description In mathematics, and more specifically in graph theory, a tree is an undirect…
Dancing Stars on Me Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 262144/262144 K (Java/Others)Total Submission(s): 186    Accepted Submission(s): 124 Problem Description The sky was brushed clean by the wind and the stars were cold in a bl…
Almost Sorted Array Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 262144/262144 K (Java/Others)Total Submission(s): 447    Accepted Submission(s): 201 Problem Description We are all familiar with sorting algorithms: quick sort, merge sort,…
Rebuild Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 262144/262144 K (Java/Others)Total Submission(s): 446    Accepted Submission(s): 113 Problem Description Archaeologists find ruins of Ancient ACM Civilization, and they want to rebuild i…