Elevator algorithm (1)
Hedgehog @ http://blog.csdn.net/littlehedgehog
The elevator algorithm is mainly used for disk seek optimization.
The first is our most primitiveFirst come first served)Algorithm. This is suitable for us to get a meal out of the restaurant first. Otherwise, our customers may have opinions. However, it is not suitable for disk searching. For example:
Note that this figure does not ex
First, design ideas(1) Save the number of floors the passengers are going to.(2) Assuming that Yi is the passenger to climb the number of floors of the sum, yi=n1*| (N1-ni) |+n2*| (N2-ni) |+. +n18*| (N18-ni) |(3) Compare the values of Y1 to Y18 to find the smallest.(4) Output resultsSecond, the source code#include "iostream.h" #include "stdlib.h" #define MAXSIZE 15void input (int num,int flour[])//Enter the number of people travelling by elevator and
POJ 2392 Space ElevatorCows want to use c_i high h_i building blocks to build the tower, each kind of building blocks can not be higher than a_i, the maximum height of the towerThe a_i must be recursively pushed from small to large to cover the entire solution space. Multiple knapsack problem1Include2#include 3 using namespacestd;4 structnode5 {6 intH,maxn,n;7 };8Node a[516];9 intdp[516][40016];Ten BOOLIs_greater (Constnode A,Constnodeb) One { A returna.maxnB.MAXN; - } - intMain () the {
(); - for(inti =0; I ) { inscanf"%d%d%d", Hi + i, ai + i, CI +i); - } toSort (ran, ran +k,cmp); +dp[0] =1; - for(inti =0; I ) { the intt =Ran[i]; *memset (Used,0,sizeof(used)); $ for(inth = hi[t]; H ) {Panax Notoginseng //Dp[h]==0 must also remember to write, here is also a greedy - if(dp[h]==0dp[h-hi[t]] Used[h-hi[t]] +1Ci[t]) { theDP[H] =1; USED[H] = used[h-hi[t]] +1; + } A } the
Simple simulation. Pay attention to the situation where a [I] = A [I-1. # Include # Include # Include # Include # Include # Include Using Namespace STD; Const Int Maxn = 100 + 10 ; Int N, a [maxn]; Int Main () {scanf ( " % D " , N ); For ( Int I = 1 ; I " % D " , A [I]); [ 0 ] = 0 ; Int Ans = 0 ; For ( Int I = 1 ; I ){ If (A [I]> A [I- 1 ]) Ans = ans + (A [I]-A [I- 1 ]) * 6 , ANS = ans +5 ; Else If (A [I] 1 ]) Ans = ans + (A [I- 1 ]-A [I]) * 4 , ANS = ans + 5
Background: The weekly question was not read at the time. Even if you read it, you can only think of violence, not AC.Learning: 1. In the case of violent search timeouts, a good algorithm must be found, which is to look at the optimal solution with a similar trend of change rather than figure out the corresponding value for each floor and find the maximum value. Train of thought: Assume current floor below has N1 person, current floor has N2 person, current floor above has N3 person. Every step
This problem is very similar to coins, it seems that the building of the man eight questions is not simple.It would be nice to have a coins-style backpack.2392#include 1276#include POJ 2392 (Space Elevator) 1276 (Cash machine) warp backpack
Please cherish small compilation of labor results, the article for the small series of original, reproduced please indicate the source.
Scan (SCAN) scheduling algorithm: Always start from the current position of the magnetic arm, along the
In ~ /Directory
Create or modify a file gedit. gitconfig
Copy the following to the default configuration.
[Color]
Ui = auto
[User]
Name = w22ee
Email = w22ee@126.com
[Alias]
St = Status
Ci = commit
BR = Branch
CO = checkout
CVSup =! Sh-C \ "Git
*Map
Map
Defines the first address of a structured memory table. In this case, the location counter of the memory table
{Var}
Set to this address value
{Var}
Is the built-in variable of the assembler.
^
And
Map
Synonymous
.
The main effect of the topic:
There are n kinds of bricks, the height of each brick is H, the quantity is C, and the highest position of it can not exceed a. How high can these bricks be stacked?
Ideas:
First of all kinds of bricks according to a
Multiple backpacks. This question does not require binary optimization. Relatively simple. Because the number of duplicates is very small, less than 10; Add a method to limit the height of each material. If you use reverse table filling, you only
Want to see more problem-solving reports:Http://blog.csdn.net/wangjian8006/article/details/7870410Reprinted please indicate the source: http://blog.csdn.net/wangjian8006
A cow is going to go to space. He has many kinds of stones. The height of each
triggers or in triggers on user's tables ALL_USERS Information about all users of the database ALL_VIEWS Text of views accessible to the user USER_AUDIT_CONNECT Audit trail entries for user logons/logoffs USER_AUDIT_OBJECT Audit trail records for statements concerning objects, specifically: table, cluster, view, index, sequence, [public] database link, [public] synonym, procedure, trigge
or in triggers on user's tables ALL_USERS Information about all users of the database ALL_VIEWS Text of views accessible to the user USER_AUDIT_CONNECT Audit trail entries for user logons/logoffs USER_AUDIT_OBJECT Audit trail records for statements concerning objects, specifically: table, cluster, view, index, sequence, [public] database link, [public] synonym, procedure, trigger,
) psychologically, when another person is by your side and works closely with you to do the same thing, you may be embarrassed to make it easy and confused.
(4) At the enterprise management level, pairing can communicate more effectively, learn from each other and pass on experience, and better handle the flow of personnel. Because one person's knowledge has been shared by others.
2,Disadvantages: First of all, the efficient pair programing can be done in less than a day or two. Everyone has the
In fact, the woman is not in the third floor dead, but in the dead after going out, the man in the third floor is not going to do, because there is a camera, he would like to do, in the first floor and the third floor hands are the same, are from outside to inside hands, will be photographed by the camera. And the man went out and smiled at her and took the knife to the 3 floor for the woman. From 2 floor to 3 floor these seconds, the normal person's first reaction is immediately press 1 floor,
Synonyms concept
The Oracle synonym (synonyms) is literally the meaning of the alias, and similar to the function of the view, is a mapping relationship. It can save a lot of database space, the operation of different users of the same table does not make much difference; it expands the scope of database usage, enables seamless interaction among different database users, and provides synonym management func
Label:A synonym is a database object that is an alias defined for a database object , and the primary purpose of using synonyms is to simplify the writing of SQL statements . The concept and type of synonyms Synonyms can be used to define an alias for an object of a user, or an object of another user , to simplify the writing of a command or program , and to use synonyms directly in a command or program instead of the original object . You can create
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.