原创 CodeForces 560C Gerald's Hexagon【思維】

Description Gerald got a very curious hexagon for his birthday. The boy found out that all the angles of the hexago

原创 CodeForces 706B Interesting drink【水題】

Description Vasiliy likes to rest after a hard work, so you may often meet him in some bar nearby. As all programme

原创 HDU 1102 Constructing Roads【最小生成樹】

Description There are N villages, which are numbered from 1 to N, and you should build some roads such that every t

原创 CSU 1216 異或最大值【字典樹】

Description 給定一些數,求這些數中兩個數的異或值最大的那個值 Input 第一行爲數字個數n,1 <= n <= 10 ^ 5。接下來n行每行一個32位有符號非負整數。 Output

原创 CodeForces 706A Beru-taxi 【水題】

Description Vasiliy lives at point (a, b) of the coordinate plane. He is hurrying up to work so he wants to get out

原创 Gym 101138I Prime Moving【素數測試】

Description standard input/outputStatements The author of this problem hopes that you already know the pig called B

原创 POJ 2891 Strange Way to Express Integers【模線性方程組】(中國剩餘定理非互質套用)

Description Elina is reading a book written by Rujia Liu, which introduces a strange way to express non-negative

原创 POJ 1006 Biorhythms【中國剩餘定理】

Description Some people believe that there are three cycles in a person's life that start the day he or she is born

原创 UVALive 6910 Cutting Tree【並查集】

題目鏈接 /* 題意:給你含有n個節點的森林,和q次操作,每次操作包含兩種情況 1. C a 表示刪除a和父親節點的連邊 2. Q a b 表示詢問a,b節點是否屬於同一個同一棵樹中

原创 UVALive 7340 Sum of MSLCM【數學】

題目鏈接 /* 題意:給定一個N,求從2~N的最小公倍數的和 類型:數學 分析:兩種姿勢可以A題,但是用時相差很大 1.用類似埃氏篩選法,處理出前綴和4000+ms 2.用類

原创 CodeForces 560B Gerald is into Art【水題】

Description Gerald bought two very rare paintings at the Sotheby's auction and he now wants to hang them on the wal

原创 UVALive 6913 I Want That Cake【博弈+記憶化搜索】【好題】

題目鏈接 /* 題意:AB 兩隊吃蛋糕,每個隊n個人,共有m塊蛋糕,每人至少吃一塊蛋糕, 最多吃k塊蛋糕,哪個隊伍吃到最後一塊就算獲勝,問你誰能勝利 類型:博弈+記憶化搜索 分析:首先,把連

原创 CodeForces 560D Equivalent Strings【遞歸+貪心】

Description Today on a lecture about strings Gerald learned a new definition of string equivalency. Two strings aan

原创 CodeForces 560A Currency System in Geraldion 【水題】

Description A magic island Geraldion, where Gerald lives, has its own currency system. It uses banknotes of several

原创 UVALive 7339 Owllen【思維】

題目鏈接 /* 題意:給定一個字符串,讓你構造一個字符串使得兩個字符串的最長公共自序列 儘可能短,輸出最短長度 類型:思維 分析:找二十六個字母中出現次數最少的,就是答案,每次構造的字符串全部