"Portal": http://www.luogu.org/problem/show?pid=1135---------------------------------------------------Topics----------------------------------------------------------Title DescriptionOh, one day I had a dream, dreamed of a very strange elevator. Elevators can be parked on each floor of the building, and there is a number Ki (0Input/output formatInput format:There are two lines in the input file, the first act three positive integers separated by spac
Document directory
Accor
Air Asia
Becel
Body World
Coke Zero
Consol Energy
Fiat Punto
Forklift
Golds Gym
Guantanamo Bay
Kung Fu Kick
Oreo
Swiss Skydiving
Superman Movie
Missing Floor
If you walk into any city, there are elevators in almost every place, But do you find any creative advertising elevator? I will share it with you in 15 different cities.Creative elevator ads c
In theory, we should first black box use case, analysis needs, system boundary input and output, and then white box class diagram. But for the real-world simulation of OO, the personal feeling first emulate the real world, initially identify the relationship between classes and classes, and then use the use cases and sequence diagrams to enrich and modify the class diagram.
The primary principle of identifying classes is encapsulation, the manipulation of data and data encapsulated into a class:
(First of all, I would like to thank dudu for reminding me to write this elevator post so that you can see the important release information of MIX11 .)
The two-day MIX11 keynote speech was over. I admit that, especially the Second-day keynote speech was the most exciting time I attended all Microsoft conferences over the past two years, and our friends on Weibo (http://weibo.com/cnmsdn) interaction is the same! The
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
contract is established. Assertions are obviously the best choice, but not all programming languages have assertions. Therefore, forced language imitation will inevitably lead to code redundancy and readability improvement. For example, before net4.0, there was no assert concept. After net4.0, the concept of contractual programming was fully introduced, greatly improving the availability of contractual programming. In addition, contractual programming is not standardized, so the definitions and
Sort + backpack.First, according to the height limit from small to large sort, and then do the backpack. 0/1 backpack More than 300 ms over, can be optimized with a full backpack binary.#include #include#include#includeusing namespacestd;Const intmaxn= -+Ten;intN;structx{intH,c,a;} S[MAXN];intdp[400000+Ten];intans;BOOLcmpConstXa,Constxb) { returna.aB.A;}voidRead () { for(intI=1; i) scanf ("%d%d%d",s[i].h,s[i].a,s[i].c); Sort (S+1, s+1+n,cmp);}voidinit () {memset (DP,0,sizeofDP); dp[0]=1; Ans=
#includeint main () {int n,ans=0,now=0;To stop n-tier, ans is the total time, now represents the current number of layers scanf ("%dfor (int i=0; iint tmp; scanf ( "%d" tmp ); if (tmp>now) //upstairs, each on a layer of 6 seconds {ans+= (tmp-now) *6; now=tmp; } else if (tmp//downstairs, each next layer 4 seconds {ans+= (now-tmp ) *4; now=tmp;} ans+=5; //not up also-stay, 5 seconds each time, go upstairs or downstairs, also have to stop 5 seconds. and together wrote} printf ( "%d", ANS); return 0
For this pair of tasks, because themselves are not in school, so there is no good way to communicate with my teammates, so my task is to establish the implementation method, and proposed algorithm, here very grateful to my two teammates, they are very responsible, as a team, very good to complete the task here, To exert their own power to the maximum.The feeling of this task is that they used to be a person to do a program Ah, task Ah, very few and one or a few people to carry out such cooperati
#include #include int main (){int n;int i,j;int num[101];while (1){int sum=0;memset (num,0,sizeof (num));scanf ("%d", n);if (n==0){Break}else{num[0]=0;for (i=1;i{scanf ("%d", num[i]);}for (i=0;i{if (num[i]{sum=sum+6* (Num[i+1]-num[i]) +5;}else if (num[i]>num[i+1])//Descent{sum=sum+4* (num[i]-num[i+1]) +5;}else if (num[i]==num[i+1]){sum=sum+5;}}printf ("%d\n", sum);}}return 0;}1, 2 times Submit are wrong answer, originally did not consider two times according to the same floor situation.Hangzhou
negative weights).As long as you can think of how to construct the algorithm. If your own algorithm, but do not know how to solve problems, it is useless. Here I would like to say to you,In the process of doing the problem later, do not just look at other people's code, to see the thought, why others write. Then write the code according to the thought of your imagination and write the process withoutLook at someone else's code. Even if it doesn't matter, this impression is the deepest, and late
Topic Pdf:http://acm.bnu.edu.cn/v3/external/124/12486.pdfApproximate test instructions: What is the number of sub-strings for Nth not containing "4" and "13", nIdea: is the general digital DP, two-point answer, the number of the answer to the number of DP figure out how many of the number of satisfied conditionsBut.... The answer to a long long, to use unsigned long long to be able to live, this pit point0 Ms 0 KB 2633 B 2015-08-15 01:02:36//#pragma comment (linker, "/stack:1024000000,1024000000
, such as two different knowledge reserves, hands-on ability differences, which will take a certain amount of time to achieve consensus. What we do is try to overcome these shortcomings at work and take advantage of the advantages of pairing programming to complete our projects faster and better.As we design our code, we are happy to use some language features and design methods to improve our code. For example, the full use of object-oriented language information hiding feature (information hid
Water problem not much said, elevator to go up also to come down so the highest layer multiplied by 10 is the time to go up and down, plus everyone out of the time, each person a second, how many different layers of how many times the door, time in different layers of superior to 5 can, the above time added is the total time.
The code is attached:
#include
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
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.