 Elevator Stopping Plan 怎么编程的

Description
ZSoft Corp. is a software company in GaoKe Hall. And the workers in the hall are very hardworking. But the elevator in that hall always drives them crazy. Why? Because there is only one elevator in GaoKe Hall, while there are hundreds of companies in it. Every morning, people must waste a lot of time waiting for the elevator.Hal, a smart guy in ZSoft, wants to change this situation. He wants to find a way to make the elevator work more effectively. But its not an easy job.
There are H floors in GaoKe Hall. It takes 4 seconds for the elevator to raise one floor. It means:It costs (n1)*4seconds if the elevator goes from the 1 st floor to the nth floor without stop. And the elevator stops 10 second once. So, if the elevator stops at each floor, it will cost (n1)*4+(n2)*10seconds (It is not necessary to calculate the stopping time at nth floor). In another way, it takes 20 seconds for the workers to go up or down one floor. It takes (n1)*20seconds for them to walk from the 1 st floor to the nth floor. Obviously, it is not a good idea. So some people choose to use the elevator to get a floor which is the nearest to their office.
After thinking over for a long time, Hal finally found a way to improve this situation. He told the elevator man his idea: First, the elevator man asks the people which floors they want to go. He will then design a stopping plan which minimize the time the last person need to arrive the floor where his office locates. For example, if the elevator is required to stop at the 4 th , 5 th and 10 th floor, the stopping plan would be: the elevator stops at 4 th and 10 th floor. Because the elevator will arrive 4 th floor at 3*4=12second, then it will stop 10 seconds, then it will arrive 10 th floor at 3*4+10+6*4=46second. People who want to go 4 th floor will reach their office at 12
second, people who want to go to 5 th floor will reach at 12+20=32second and people who want to go to 10 th floor will reach at 46 second. Therefore it takes 46 seconds for the last person to reach his office. It is a good deal for all people.
Now, you are supposed to write a program to help the elevator man to design the stopping plan,which minimize the time the last person needs to arrive at his floor.
InputThe input consists of several test cases. Each test case is in a single line as the following:
n f1 f2 ... fnIt means, there are totally n floors at which the elevator need to stop, and n = 0 means no testcases
any more. f1 f2 ... fn are the floors at which the elevator is to be stopped (1<=n<=30000, 2<=f1< f2 ... fn<=30000). Every number is separated by a single space.
OutputFor each testcase, output the time the last reading person needs in the a single line
Sample Input3 4 5 10
1 2
0
Sample Output46
4
Elevator Stopping Plan _course
20170918Description ZSoft Corp. is a software company in GaoKe Hall. And the workers in the hall are very hardworking. But the elevator in that hall always drives them crazy. Why? Because there is only one elevator in GaoKe Hall, while there are hundreds of companies in it. Every morning, people must waste a lot of time waiting for the elevator.Hal, a smart guy in ZSoft, wants to change this situation. He wants to find a way to make the elevator work more effectively. But its not an easy job. There are H floors in GaoKe Hall. It takes 4 seconds for the elevator to raise one floor. It means:It costs (n1)*4seconds if the elevator goes from the 1 st floor to the nth floor without stop. And the elevator stops 10 second once. So, if the elevator stops at each floor, it will cost (n1)*4+(n2)*10seconds (It is not necessary to calculate the stopping time at nth floor). In another way, it takes 20 seconds for the workers to go up or down one floor. It takes (n1)*20seconds for them to walk from the 1 st floor to the nth floor. Obviously, it is not a good idea. So some people choose to use the elevator to get a floor which is the nearest to their office. After thinking over for a long time, Hal finally found a way to improve this situation. He told the elevator man his idea: First, the elevator man asks the people which floors they want to go. He will then design a stopping plan which minimize the time the last person need to arrive the floor where his office locates. For example, if the elevator is required to stop at the 4 th , 5 th and 10 th floor, the stopping plan would be: the elevator stops at 4 th and 10 th floor. Because the elevator will arrive 4 th floor at 3*4=12second, then it will stop 10 seconds, then it will arrive 10 th floor at 3*4+10+6*4=46second. People who want to go 4 th floor will reach their office at 12 second, people who want to go to 5 th floor will reach at 12+20=32second and people who want to go to 10 th floor will reach at 46 second. Therefore it takes 46 seconds for the last person to reach his office. It is a good deal for all people. Now, you are supposed to write a program to help the elevator man to design the stopping plan,which minimize the time the last person needs to arrive at his floor. Input The input consists of several test cases. Each test case is in a single line as the following: n f1 f2 ... fn It means, there are totally n floors at which the elevator need to stop, and n = 0 means no testcases any more. f1 f2 ... fn are the floors at which the elevator is to be stopped (1<=n<=30000, 2<=f1< f2 ... fn<=30000). Every number is separated by a single space. Output For each testcase, output the time the last reading person needs in the a single line Sample Input 3 4 5 10 1 2 0 Sample Output 46 4
Go , SuSu 的编写_course
20200107Problem Description When SuSu and his friends visited GanQuan village , something dangerous happened on them . They were trapped in a mysterious cave , what was worse ,there was a terrible monster lived in the cave , so they had to escape from the cave as quickly as possible . But little monsters were also in the cave, as a result ,when SuSu was seen by the little monsters ,they would notice their boss to catch SuSu back. Little monsters' visual field is showed in figure A. The grid colored red represents where the monster stands, the arrow represents which direction the monster walk to ,and the grids colored blue and red represents where the very monster can see at this moment. The monsters often walks in a straight line, and when they faces a wall or the boundary of the maze in front of him, they will cost 1 seconds to turn back, and then walk back along the straight line, until reach a wall again. If SuSu was seen by the monsters ,it's impossible for them to escape from the cave . SuSu needs your help , please tell him the minimum time he needs to walk from the start point to the exit of the cave , be careful not to be seen by the monsters. Every seconds SuSu can move upward downward leftward and rightward , and can also make no movement. Figure A Input The first line of input gives the number of cases, T (at most 90). the first line of each case has four numbers n,m. (2<=n,m<=50) then n lines with m characters describe the maze 'A' represents the init position of SuSu. 'B' represents the exit position of the cave. '.' represents the grids can be walked on. '*' represents the wall which can not be stepped on. Then follows a number k (at most 50). Next k lines with three integers x , y , d (1 <= x <= n,1 <= y <= m,1 <= d <= 4).represents a monster walking to d direction is in (x,y) positon (the topleft grid is (1,1) ) at 0 seconds . The monster walks up when d == 1. walk down when d == 2.walk left when d == 3.walk right when d == 4. Output If SuSu can get to the exit in 1000 seconds ,output the minimum time he need. print "胜败兵家事不期 卷土重来是大侠" otherwise. Following the case number (start with 1). Sample Input 1 3 4 *.*. .A.B ***. 1 3 4 1 Sample Output Case 1: 2
排序，输出出现次数最多的颜色，用C语言怎么实现？_course
20181229Problem Description Contest time again! How excited it is to see balloons floating around. But to tell you a secret, the judges' favorite time is guessing the most popular problem. When the contest is over, they will count the balloons of each color and find the result. This year, they decide to leave this lovely job to you. Input Input contains multiple test cases. Each test case starts with a number N (0 < N <= 1000)  the total number of balloons distributed. The next N lines contain one color each. The color of a balloon is a string of up to 15 lowercase letters. A test case with N = 0 terminates the input and this test case is not to be processed. Output For each case, print the color of balloon for the most popular problem on a single line. It is guaranteed that there is a unique solution for each test case. Sample Input 5 green red blue red red 3 pink orange pink 0 Sample Output red pink
输出多项式的系数使得给定的方程成立，怎么用C语言的程序的设计的代码编写的思想方法来实现的_course
20190613Problem Description Li Zhixiang have already been in “Friendship” oceangoing freighter for three months. The excitement has gradually disappeared. He stands on the board, holding the railing and watching the dazzling ocean in the sun silently. Day after day, the same scenery is monotonous and tasteless, even the merry seagulls following the freighter cannot arouse his interest. Hearing the footsteps behind, he turns back to see the old captain is coming towards him. The captain has understood his idea, however, he starts a new topic with the young man. “Do you know how far our voyage is?” The captain asks. Li Zhixiang feels ashamed because he can not answer. Then the captain says with a smile, “5050 miles. Do you still remember the story of 5050?” This time the young man really blushes. The old captain continues saying:” You definitely know the story of 5050. When the German mathematician, “the prince of mathematicians”, Gauss was 10 years old …” Young man remembers this story and goes on to tell, “ When Gauss was 10 years old, he could add a list of integers from 1 to 100 in a few seconds, which shocked the teachers.” The old captain adds, “Gauss has many other stories like this. When he entered the university at the age of 17, he was able to construct heptadecagon by compass and straightedge. His university teachers were also impressed by his ability. Not only could college graduate students fail to do it, but also they felt hard to understand Gauss’s constructing process.” At this time, vicecaptain greets the old captain. The old captain says to Li Zhixiang: “Come over to my office tonight, let’s continue the conversation.” It is still calm and tranquil in the evening. The freighter travels smoothly on the sea in the silver moonlight. The captain tells the young man the following words. Among the mathematicians through the ages, there are three greatest mathematicians: Archimedes, Newton and Gauss. Most of Gauss’s mathematical achievements are difficult to understand. Nevertheless, there are some comparatively easy. For instance, when it comes to solving multivariate system of linear equations, there is a solution called “Gauss Elimination”. In the navigation business, many problems can be solved by “Gauss elimination”. If you are interested in it, I will show you a simple question. Try it.” Input There are several test cases. In the first line of each case, a number n indicates that there are n equations. The following n lines, each line has n+1 numbers, ai1,ai2,ai3…..ain, bi(1<= i <=n), these numbers indicate the coefficients of systems of the equations. ai1*x1+ai2*x2+......ain*xn=bi. Input is terminated by the end of file. Output For each given systems of equations, if there are solutions, output n solutions in the order of appearance in the equations（n<=100）, each solution number is in one line. If solution is not integer, show it in fraction. If no solution, output “No solution.” Leave a blank line after each case. Sample Input 2 1000000000000000000000000 1000000000000000000000000 1000000000000000000000000 1000000000000000000000000 1000000000000000000000000 0 1 0 4 Sample Output 1/2 1/2 No solution.
Range 区间的问题_course
20200416Problem Description Some automobiles display the estimated driving range, that is, the distance you can expect to drive it (without adding fuel) before running out of fuel. Here is how it works: periodically, the vehicle's computer records the odometer reading and the weight of fuel in the fuel tank. From this data, the fuel consumption over a certain distance can be computed. From the fuel consumption and the most recent measurement of fuel tank contents (which we assume is current for all practical purposes), the range can be calculated. Intervals over which the quantity of fuel increased (fuel was added to the tank) will not be used in the computations. For example, in the first problem instance of the sample input, the interval where the fuel weight increased from 29.9 kilograms to 34.2 kilograms will not be used. In this example, 16.3 kilograms of fuel were consumed over a distance of 228.6 kilometers. Therefore, the most recently measured fuel contents of 31.2 kilograms will enable you to drive another 438 kilometers (rounded to the nearest integer). The input will always contain at least one interval (two consecutive lines of input) where no fuel was added to the tank. Input The input contains data for a number of problem instances. Each problem instance consists of three or more (odometer reading, fuel weight) pairs, one pair per line. Distances are measured in kilometers and fuel weight in kilograms. All input numbers will be given to one decimal place. The end of each problem instance will be signaled by a (0.0, 0.0) pair. The last problem instance will be followed by a (1.0, 1.0) pair. Output For each problem instance, print the range, rounded to the nearest integer. Sample Input 18400.5 43.2 18440.4 40.4 18482.7 37.0 18540.2 33.1 18585.3 29.9 18620.8 34.2 18664.6 31.2 0.0 0.0 18400.5 43.2 18440.4 40.4 18482.7 37.0 18540.2 33.1 18585.3 29.9 0.0 0.0 1.0 1.0 Sample Output 438 415
怎么运用 C 语言的程序，Cylinder_course
20190810Problem Description Using a sheet of paper and scissors, you can cut out two faces to form a cylinder in the following way: 1. Cut the paper horizontally (parallel to the shorter side) to get two rectangular parts. 2. From the first part, cut out a circle of maximum radius. The circle will form the bottom of the cylinder. 3. Roll the second part up in such a way that it has a perimeter of equal length with the circle's circumference, and attach one end of the roll to the circle. Note that the roll may have some overlapping parts in order to get the required length of the perimeter. Given the dimensions of the sheet of paper, can you calculate the biggest possible volume of a cylinder which can be constructed using the procedure described above? Input The input consists of several test cases. Each test case consists of two numbers w and h (1 ≤ w ≤ h ≤ 100), which indicate the width and height of the sheet of paper. The last test case is followed by a line containing two zeros. Output For each test case, print one line with the biggest possible volume of the cylinder. Round this number to 3 places after the decimal point. Sample Input 10 10 10 50 10 30 0 0 Sample Output 54.247 785.398 412.095
Elevator Stopping Plan 正确的实现方式_course
20190914Description ZSoft Corp. is a software company in GaoKe Hall. And the workers in the hall are very hardworking. But the elevator in that hall always drives them crazy. Why? Because there is only one elevator in GaoKe Hall, while there are hundreds of companies in it. Every morning, people must waste a lot of time waiting for the elevator.Hal, a smart guy in ZSoft, wants to change this situation. He wants to find a way to make the elevator work more effectively. But its not an easy job. There are H floors in GaoKe Hall. It takes 4 seconds for the elevator to raise one floor. It means:It costs (n1)*4seconds if the elevator goes from the 1 st floor to the nth floor without stop. And the elevator stops 10 second once. So, if the elevator stops at each floor, it will cost (n1)*4+(n2)*10seconds (It is not necessary to calculate the stopping time at nth floor). In another way, it takes 20 seconds for the workers to go up or down one floor. It takes (n1)*20seconds for them to walk from the 1 st floor to the nth floor. Obviously, it is not a good idea. So some people choose to use the elevator to get a floor which is the nearest to their office. After thinking over for a long time, Hal finally found a way to improve this situation. He told the elevator man his idea: First, the elevator man asks the people which floors they want to go. He will then design a stopping plan which minimize the time the last person need to arrive the floor where his office locates. For example, if the elevator is required to stop at the 4 th , 5 th and 10 th floor, the stopping plan would be: the elevator stops at 4 th and 10 th floor. Because the elevator will arrive 4 th floor at 3*4=12second, then it will stop 10 seconds, then it will arrive 10 th floor at 3*4+10+6*4=46second. People who want to go 4 th floor will reach their office at 12 second, people who want to go to 5 th floor will reach at 12+20=32second and people who want to go to 10 th floor will reach at 46 second. Therefore it takes 46 seconds for the last person to reach his office. It is a good deal for all people. Now, you are supposed to write a program to help the elevator man to design the stopping plan,which minimize the time the last person needs to arrive at his floor. Input The input consists of several test cases. Each test case is in a single line as the following: n f1 f2 ... fn It means, there are totally n floors at which the elevator need to stop, and n = 0 means no testcases any more. f1 f2 ... fn are the floors at which the elevator is to be stopped (1<=n<=30000, 2<=f1< f2 ... fn<=30000). Every number is separated by a single space. Output For each testcase, output the time the last reading person needs in the a single line Sample Input 3 4 5 10 1 2 0 Sample Output 46 4
等差数列的问题，采用C 语言如何才能进行求解呢？？_course
20190107Problem Description A sequence b1,b2,⋯,bn are called (d1,d2)arithmetic sequence if and only if there exist i(1≤i≤n) such that for every j(1≤j<i),bj+1=bj+d1 and for every j(i≤j<n),bj+1=bj+d2. Teacher Mai has a sequence a1,a2,⋯,an. He wants to know how many intervals [l,r](1≤l≤r≤n) there are that al,al+1,⋯,ar are (d1,d2)arithmetic sequence. Input There are multiple test cases. For each test case, the first line contains three numbers n,d1,d2(1≤n≤105,d1,d2≤1000), the next line contains n integers a1,a2,⋯,an(ai≤109). Output For each test case, print the answer. Sample Input 5 2 2 0 2 0 2 0 5 2 3 2 3 3 3 3 Sample Output 12 5
首字母变大写 应该如何实现呢_course
20200526Problem Description 输入一个英文句子，将每个单词的第一个字母改成大写字母。 Input 输入数据包含多个测试实例，每个测试实例是一个长度不超过100的英文句子，占一行。 Output 请输出按照要求改写后的英文句子。 Sample Input i like acm i want to get an accepted Sample Output I Like Acm I Want To Get An Accepted
C 语言来实现进制转换_course
20190819Problem Description 输入一个十进制数N，将它转换成R进制数输出。 Input 输入数据包含多个测试实例，每个测试实例包含两个整数N(32位整数)和R（2<=R<=16, R<>10）。 Output 为每个测试实例输出转换后的数，每个输出占一行。如果R大于10，则对应的数字规则参考16进制（比如，10用A表示，等等）。 Sample Input 7 2 23 12 4 3 Sample Output 111 1B 11
模仿通配符的定义实现字符串的模糊查询问题，怎么采用C程序的语言的编写的思路实现_course
20190419Problem Description WisKey downloaded much software in winter vacation, and the disk was in a state of confusion. He wastes many times to find the file everyday. So he wants a tool to help him do this work. The file name consists of lowercase letters. The name pattern is a string of lowercases, '?'s and '*'s. In a pattern, a '?' matches any single lowercase, and a '*' matches none or more lowercases. Let’s do this~ Input The first line of input contains two integers N (0 < N <= 10000) and M (0 < M <=100), representing the number of file names and the number of word patterns. Each of the following N lines contains a file name. After those, each of the last M lines contains a name pattern. You can assume that the length of patterns will not exceed 6, and the length of file names will not exceed 20. There are multiple cases in the data file, process to end of file. Output For each pattern, print a line contains the number of matched file names. If there is no file name that can match the pattern, print "Not match". Sample Input 4 5 this the an is t* ?h*s ??e* *s e Sample Output 2 1 1 2 Not match
偶数求和 是怎么实现的呢_course
20200526偶数求和 Problem Description 有一个长度为n(n<=100)的数列，该数列定义为从2开始的递增有序偶数，现在要求你按照顺序每m个数求出一个平均值，如果最后不足m个，则以实际数量求平均值。编程输出该平均值序列。 Input 输入数据有多组，每组占一行，包含两个正整数n和m，n和m的含义如上所述。 Output 对于每组输入数据，输出一个平均值序列，每组输出占一行。 Sample Input 3 2 4 2 Sample Output 3 6 3 7
从Golang的stdin读取_course
20150315<div class="posttext" itemprop="text"> <p>I'm trying to read from Stdin in Golang as I'm trying to implement a driver for Erlang. I have the following code:</p> <pre><code>package main import ( "fmt" "os" "bufio" "time" ) func main() { go func() { stdout := bufio.NewWriter(os.Stdin) p := []byte{121,100,125,' '} stdout.Write(p) }() stdin := bufio.NewReader(os.Stdin) values := make([]byte,4,4) for{ fmt.Println("b") if read_exact(stdin) > 0 { stdin.Read(values) fmt.Println("a") give_func_write(values) }else{ continue } } } func read_exact(r *bufio.Reader) int { bits := make([]byte,3,3) a,_ := r.Read(bits) if a > 0 { r.Reset(r) return 1 } return 1 } func give_func_write(a []byte) bool { fmt.Println("Yahu") return true } </code></pre> <p>However it seems that the <code>give_func_write</code> is never reached. I tried to start a goroutine to write to standard input after 2 seconds to test this.</p> <p>What am I missing here? Also the line <code>r.Reset(r)</code>. Is this valid in go? What I tried to achieve is simply restart the reading from the beginning of the file. Is there a better way?</p> <p><strong>EDIT</strong></p> <p>After having played around I was able to find that the code is stuck at <code>a,_ := r.Read(bits)</code> in the <code>read_exact</code> function</p> </div>
数字的多次的迭代的算法的问题的解决的方式，用的是C程序的语言的编写的过程怎么做_course
20190409Problem Description For any positive integer n, we define function F(n) and XEN(n). For a collection S(n)={1,2,...,2n}, we select some numbers from it. For a selection, if each selected number could not be divided exactly by any other number in this selection, we will call the selection good selection. Further, we call a good selection best selection if the selection has more elements than any other good selection from S(n). We define F(n) the number of elements in the best selection from S(n). For example, n=2, F(n)=2. From the collection {1,2,3,4}, we can make good selection just like {2,3} or {3,4}, but we can't make any larger selection. So F(2) = 2. Then we pay attention to XEN(n). For every S(n), there are always some numbers could not be selected to make up any best selection. For instance, when n=2, 1 is always could not be chosen. What's more, for every S(n), there is a number k which satisfies that all the number, from 0 to k, are always could not be chosen. Now we let XEN(n)=k: n=2, F(n)=2, XEN(2)=1; n=4, F(n)=4, XEN(4)=1. You should write a program to calculate the value of F(n) and XEN(n) with a given number n. Input Your program is to read from standard input. There are multiple cases. For each case, one integer n (1 ≤ n ≤ 10^7) in a line. Output Output two integers with one space between them in one line per case. Sample Input 2 4 Sample Output 2 1 4 1
SCV集合的查询和数组操作的问题，采用C技术语言_course
20190123Problem Description StarCraft 2 (SC2) is a famous game. More and more people fall in love with this game. As a crazy fan of SC2, Ahua (flower fairy) play it day and night. Recently, he found that the most important part of being a top player of SC2 is economic development, which means you should get as much mine as possible by training SCVs (space construction vehicle) to collect mine. Train a SCV at ith second costs Ci units of mine. After training, this SCV can collect Di units of mine each second. Training a SCV needs one second of time. Based on that, he composes a formula to evaluate the development in a time span from xth second to yth second. Assume at xth second, Ahua has no SCV and mine. He trains one SCV at each second during xth second and yth second (the mount of mine can be negative, so that he always can train SCV). Each SCV will collect some amount of mines for Ahua in each second after it was trained. At ith second Ahua has Mi units of mine in total. The development value is defined as sum(Mi) (x ≤ i ≤ y). Now he asks you to help him calculate the development value. To make it more interesting, Ahua can apply following operations: Cost x y z: the cost of training a SCV between xth second to yth second will increase by z units of mine. i.e. Ci for x ≤ i ≤ y will increase by z. Collect x y z: each SCV trained between xth second and yth second can collect z more mines every second after it has been trained. i.e. Di for x ≤ i ≤ y will increase by z. Query x y: output the development value between xth second and yth second. Input First line of the input is a single integer T (T ≤ 10), indicates there are T test cases. For each test case, the first line is an integer N (1 ≤ N ≤ 100000), means the maximum time you should deal with. Following N lines, each contain two integers Ci and Di (0 ≤ Ci, Di ≤ 100000), the cost and collect speed of SCV training in ith second initially as described above. The next line is an integer Q (1 ≤ Q ≤ 10000), the number of operations you should deal with. Then Q lines followed, each line will be “Cost x y z”, "Collect x y z” or “Query x y”. 1 ≤ x ≤ y ≤ N, 0 ≤ z ≤ 100000 Output For each test case, first output “Case k: “ in a single line, k is the number of the test case, from 1 to T. Then for each "Q x y", you should output a single line contains the answer mod 20110911. Sample Input 1 5 1 3 2 3 3 1 2 2 3 3 5 Query 1 3 Cost 2 2 1 Query 1 3 Collect 1 1 5 Query 1 3 Sample Output Case 1: 2 0 15
数据结构字符串数组的一个运用，怎么采用C程序编写的语言的算法实现的程序？_course
20190502Problem Description Name PK is a funny game on the Internet. The game will calculate character's property based on its name. Now we're simulating a simple Name PK game. Each character has 3 parameters: HP, STR and SPD (HP for health point, STR for strength and SPD for attacking speed). For a name string of length N, Ci is ASCII code (decimal) of the ith char. PK rule: 1. Timer begins to increase from 1. When it is a multiple of (20SPD), the corresponding character A has that SPD attack once, the opposite lose STR(A's) HP. 2. When any side has a HP ≤ 0, the PK is over. Input The input consists of several test cases. The first line of input consists of an integer T, indicating the number of test cases. Each test case is on a separate line, and it consists two strings separated by a whitespace, indicating the name of the characters. Technical Specification 1. Names contain only English letters. 2. The length of each character's name is more than 1 and no more than 20. 3. T ≤ 1000. Output For each test case, output a line consisting of the result of the first character: "win", "lose" or "tie". Sample Input 3 Sylvia xay Ivan Stacy Boyd Greg Sample Output lose win lose
C语言作为一种高级语言，有3个优点，除了代码效率高，还有什么别的优点_course
20191231C语言作为一种高级语言，有3个优点，除了代码效率高，还有什么别的优点
矩阵和行列式的一种计算的方式的问题，怎么采用 C 程序的语言代码的编写过程去实现呢？_course
20190518Problem Description There is a matrix M that has n rows and m columns (1≤n≤1000,1≤m≤1000).Then we perform q(1≤q≤100,000) operations: 1 x y: Swap row x and row y (1≤x,y≤n); 2 x y: Swap column x and column y (1≤x,y≤m); 3 x y: Add y to all elements in row x (1≤x≤n,1≤y≤10,000); 4 x y: Add y to all elements in column x (1≤x≤m,1≤y≤10,000); Input There are multiple test cases. The first line of input contains an integer T(1≤T≤20) indicating the number of test cases. For each test case: The first line contains three integers n, m and q. The following n lines describe the matrix M.(1≤Mi,j≤10,000) for all (1≤i≤n,1≤j≤m). The following q lines contains three integers a(1≤a≤4), x and y. Output For each test case, output the matrix M after all q operations. Sample Input 2 3 4 2 1 2 3 4 2 3 4 5 3 4 5 6 1 1 2 3 1 10 2 2 2 1 10 10 1 1 1 2 2 1 2 Sample Output 12 13 14 15 1 2 3 4 3 4 5 6 1 10 10 1
用C语言进行，超大数字的计算问题_course
20190809Description In how many ways can you tile a 2xn rectangle by 2x1 or 2x2 tiles? Here is a sample tiling of a 2x17 rectangle. Input Input is a sequence of lines, each line containing an integer number 0 <= n <= 250. Output For each line of input, output one integer number in a separate line giving the number of possible tilings of a 2xn rectangle. Sample Input 2 8 12 100 200 Sample Output 3 171 2731 845100400152152934331135470251 1071292029505993517027974728227441735014801995855195223534251
图形的旋转问题 Endless Spin_course
20190825Problem Description I spin it again and again,and throw it away finally. So now I have a row of n ball,named from 1 to n,each ball is white initially. At each step I randomly chose a interval [l, r] and paint all ball in this interval to black. It means every interval have a equal chance of being chosen. And I'll stop if all ball are black.What is the expected steps before I stop? Input The first line contains integer T(1<=T<=50). Denoting the number of the test cases. Then T lines follows, each line contains an integer n (1<=n<=50). Output For each test cases,print the answer in a line. Print the answer rounded to 15 decimal places. Sample Input 3 1 2 3 Sample Output 1.000000000000000 2.000000000000000 2.900000000000000
水仙花数怎么计算的，用C语言_course
20190828Problem Description 春天是鲜花的季节，水仙花就是其中最迷人的代表，数学上有个水仙花数，他是这样定义的： “水仙花数”是指一个三位数，它的各位数字的立方和等于其本身，比如：153=1^3+5^3+3^3。 现在要求输出所有在m和n范围内的水仙花数。 Input 输入数据有多组，每组占一行，包括两个整数m和n（100<=m<=n<=999）。 Output 对于每个测试实例，要求输出所有在给定范围内的水仙花数，就是说，输出的水仙花数必须大于等于m,并且小于等于n，如果有多个，则要求从小到大排列在一行内输出，之间用一个空格隔开; 如果给定的范围内不存在水仙花数，则输出no; 每个测试实例的输出占一行。 Sample Input 100 120 300 380 Sample Output no 370 371
水仙花数 C语言_course
20191206Problem Description 春天是鲜花的季节，水仙花就是其中最迷人的代表，数学上有个水仙花数，他是这样定义的： “水仙花数”是指一个三位数，它的各位数字的立方和等于其本身，比如：153=1^3+5^3+3^3。 现在要求输出所有在m和n范围内的水仙花数。 Input 输入数据有多组，每组占一行，包括两个整数m和n（100<=m<=n<=999）。 Output 对于每个测试实例，要求输出所有在给定范围内的水仙花数，就是说，输出的水仙花数必须大于等于m,并且小于等于n，如果有多个，则要求从小到大排列在一行内输出，之间用一个空格隔开; 如果给定的范围内不存在水仙花数，则输出no; 每个测试实例的输出占一行。 Sample Input 100 120 300 380 Sample Output no 370 371
程序员的兼职技能课
20200424获取讲师答疑方式： 在付费视频第一节(触摸命令_ALL)片头有二维码及加群流程介绍 限时福利 原价99元，今日仅需39元！购课添加小助手（微信号：csdn590）按提示还可领取价值800元的编程大礼包！ 讲师介绍： 苏奕嘉 前阿里UC项目工程师 脚本开发平台官方认证满级（六级）开发者。 我将如何教会你通过【定制脚本】赚到你人生的第一桶金？ 零基础程序定制脚本开发课程，是完全针对零脚本开发经验的小白而设计，课程内容共分为3大阶段： ①前期将带你掌握Q开发语言和界面交互开发能力； ②中期通过实战来制作有具体需求的定制脚本； ③后期将解锁脚本的更高阶玩法，打通任督二脉； ④应用定制脚本合法赚取额外收入的完整经验分享，带你通过程序定制脚本开发这项副业，赚取到你的第一桶金！
 下载 PHP原生多图片上传实例.rar
 学院 第二阶段4.3：Spring Boot的核心特性及设计思想
 学院 Qt入门和上位机开发实战
 博客 go语言 面对对象编程（转）
 下载 单图片裁剪上传实例(后端开发).rar
 博客 常见面试题整理数据库篇（每位开发者必备）
 博客 蓄电池在线监测及远程自动维护系统技术参数及原理介绍
 博客 java之文件写入
 博客 JavaSE学习 巩固+总结02
 博客 go语言可见性规则验证
 博客 编程语言是选择Java好还是Python好？
 博客 02 11 字符串拷贝（赋值、指针、指针极简洁写法）
 博客 12V240V蓄电池放电容量测试仪（放电仪）功能介绍及技术参数
 下载 protobufcpp.rar
 博客 蓄电池充放电一体机(铅酸电池组和铁锂电池组)放电、充电、循环充电设备应用
 下载 选择数字电源集成电路（IC）的秘诀
 学院 大厂安全运营实战/安全法/渗透测试/代码审计/等保测评
 学院 Kubernetes中间件容器化
 下载 Zigbee组网原理详解
 博客 sqlserver通过递归查找所有下级或上级
 下载 采用ZigBee PRO自己动手设计的工业用无线传感器网络
 博客 快速幂与矩阵快速幂Tr A
 学院 Python全栈之Django开发
 下载 对比三种模块化数据中心技术
 下载 浅谈应用视觉传感器的高精度定位控制的分析
 学院 实用数据分析方法：利用python进行数据分析
 下载 mnist手写数字识别数据集npz文件.zip
 博客 [C++]ifstream和getline获取中文乱码解决方案
 博客 常见面试题整理计算机网络篇（每位开发者必备）
 学院 C语言项目：图书管理系统