U-space Elevator
Time limit:1000MS Memory Limit:65536KB 64bit IO Format:%i64d %i64 U
Submit
Status
DescriptionThe cows is going to space! They plan to achieve orbit by building a sort of space elevator:a giant Tower of blocks. They has K (1
Help the cows build the tallest space elevator possible by stacking blocks on top of each of the other according to the rules.
Input* Line 1: A single i
(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
Tags: des Io OS ar use for strong SP data
Paired person: Ma zuolin Wang Di
1. Pair Programming
1.1 Pair Programming advantages and disadvantages
(1) The first step is the high efficiency of Pair programming. During Pair programming, two people can do different units separately or the same unit at the same time. In some simple units of the project, a person can assign a simple unit to different people. For the core unit, such as the elevator Scheduling
Description The cows is going to space! They plan to achieve orbit by building a sort of space elevator:a giant Tower of blocks. They has K (1 400 ) different Types of blocks with which to build the tower. Each block of type I have height h_i (1 100 ) and is available in Quantity C_i (1 10 ). Due to possible damage caused by cosmic rays, no part of a block of type I can exceed a maximum altitude a_i (1 40000 ). Help the cows build the tallest space el
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 spaces, representing N,a,b (1≤n≤200, 1≤a,b≤n), and the second act N a positive integer separated by a space, representing Ki.Output format:Output file only one line, that
"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:
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
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
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.