原创 A + B for you again hdu 1867

題目: Generally speaking, there are a lot of problems about strings processing. Now you encounter another such problem. I

原创 Frosh Week HDU - 3743

題目: During Frosh Week, students play various fun games to get to know each other and compete against other teams. In on

原创 upper_bound()和low_bound函數的基本使用和理解(轉)

博客鏈接:https://blog.csdn.net/sdz20172133/article/details/80101838

原创 I Hate It 線段樹

題目: 很多學校流行一種比較的習慣。老師們很喜歡詢問,從某某到某某當中,分數最高的是多少。  這讓很多學生很反感。  不管你喜不喜歡,現在需要你做的是,就是按照老師的要求,寫一個程序,模擬老師的詢問。當然,老師有時候需要更新某位同學的成績

原创 Math CodeForces - 1062B

題目: 傳送門   題意: 輸入一個n,問經過最少多少次操作可以使n變得最小、最小值是多少? 操作一:把n乘以一個數; 操作二:把n開平方;   思路: 把n化爲質因數相乘的形式,比如一個數可以化爲2^4*3^5*5^7*7^2; 找出指

原创 Cutting Out CodeForces - 1077D

題目: You are given an array s consisting of n integers. You have to find any array t of length kk such that you can cut

原创 Line

題目: A line on the plane is described by an equation Ax + By + C = 0. You are to find any point on this line, whose coor

原创 Aladdin and the Flying Carpet

題目: It's said that Aladdin had to solve seven mysteries before getting the Magical Lamp which summons a powerful Genie.

原创 統計難題

題目: Ignatius最近遇到一個難題,老師交給他很多單詞(只有小寫字母組成,不會有重複的單詞出現),現在老師要他統計出以某個字符串爲前綴的單詞數量(單詞本身也是自己的前綴).  Input 輸入數據的第一部分是一張單詞表,每行一個單詞

原创 二叉搜索樹

題目: 判斷兩序列是否爲同一二叉搜索樹序列 Input 開始一個數n,(1<=n<=20) 表示有n個需要判斷,n= 0 的時候輸入結束。  接下去一行是一個序列,序列長度小於10,包含(0~9)的數字,沒有重複數字,根據這個序列可以構造

原创 超級密碼

題目: Ignatius花了一個星期的時間終於找到了傳說中的寶藏,寶藏被放在一個房間裏,房間的門用密碼鎖起來了,在門旁邊的牆上有一些關於密碼的提示信息:  密碼是一個C進制的數,並且只能由給定的M個數字構成,同時密碼是一個給定十進制整數N

原创 Anniversary party

題目: There is going to be a party to celebrate the 80-th Anniversary of the Ural State University. The University has a

原创 Tree

題目: You are to determine the value of the leaf node in a given binary tree that is the terminal node of a path of least

原创 The order of a Tree

題目: As we know,the shape of a binary search tree is greatly related to the order of keys we insert. To be precisely:  1

原创 The Falling Leaves

題目: 題目連接:https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=640   題意: 給一個先