Question type: Mathematics
Problem solving process:
The question is very simple, but the disgusting precision problem is not considered, and the cup will eventually continue with history... Do not use integer output reason: the N of the question
Problem description: The cost of calculating an addition is the sum of two integers, and the total cost of calculating an addition formula is calculated.
Type: HaffmanAlgorithm
Solution: Do you only need to use two queues to simulate hafman or
Question type: Mathematics
Solution:
This question can be converted to: calculate n ^ I = num, (n + 1) ^ I = H; then calculate the sum of the proportional series. Note: when the equality factor q is equal to 1, we should discuss it separately ...
[Preface]
On Saturday, I ran to the lab for review.
Half of the review shows a contest. After reading a question, I thought I could do it, and then I got yy.
And then it's out of control ......
I did not do ACM for a long time and have been busy
Palindrome
Time limit:3000 Ms
Memory limit:65536 K
Total submissions:31491
Accepted:10509
Description
A palindrome is a regular rical string, that is, a string read identically from left to right as well as
Http://acm.hdu.edu.cn/showproblem.php? PID = 1, 1166
For details about the tree array, Baidu has a lot of related information.# Include
Using namespace STD;
Const int maxn = 50010;// Long data [maxn];Long result [maxn];Long N;Int lowbit (int t){//
Vito shoshould live on the street which is the median of his relatives.
Code:
/*************************************** **********************************
* Copyright (c) 2008 by liukaipeng *
* Liukaipeng at gmail dot com *
*********************
I just simulate the flipping. we are not required to find the optimal solution, so I choose a way easy to understand. I find the biggest cake in the unsorted stack, and then check its position. if it is at the bottom of the stack, then nothing need
Question type: Stack Simulation
Problem solving experience: crash ....
Question: (from Baidu space on spark)
Your task is to simulate a card game called "accordian". Its rules are as follows:
A deck of playing cards has 52 cards. First, arrange one
We can solve this problem by simulating the calculating process of multiply two numbers on the paper, yet we 've already known the product. we guess the least significant digit of one number, multiply it with the other number to get a 1 of the least
Just like find a number in a binary search tree. The only trick is keeping record of the current node's left and right node to get to its child node.
Code:
/*************************************** **********************************
* Copyright
Checking the Kings against others may be faster than checking reversely. I check the knights first and then pawns. all the others are checked by walking along in the eight directions ctions. you must be very cautious in coding. A minor typo wowould
I use the naive string SEARCH method that scans for the eight directions ctions at each point in the matrix. Due to the relatively small input size, this method works well enough to get the top 20% ranking.
Code:
/*********************************
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service