-
Input
The first line of the input contains a single integer T (1 <= T <= 20), the number of test cases. Then T cases follow. The first line of each case contains N, and the second line contains N integers giving the time for each people to cross the river. Each case is preceded by a blank line. There won t be more than 1000 people and nobody takes more than 100 seconds to cross.
Output
For each test case, print a line containing the total number of seconds required for all the N people to cross the river.
Sample Input
1
4
1 2 5 10
Sample Output
17
標簽:
the
contains
integer
number
上傳時間:
2015-10-27
上傳用戶:plsee
-
Input
The input contains blocks of 2 lines. The first line contains the number of sticks parts after cutting, there are at most 64 sticks. The second line contains the lengths of those parts separated by the space. The last line of the file contains zero.
Output
The output should contains the smallest possible length of original sticks, one per line.
Sample Input
9
5 2 1 5 2 1 5 2 1
4
1 2 3 4
0
Sample Output
6
5
標簽:
contains
The
blocks
number
上傳時間:
2015-10-27
上傳用戶:lepoke
-
Input
The input consists of two lines. The first line contains two integers n and k which are the lengths of the array and the sliding window. There are n integers in the second line.
Output
There are two lines in the output. The first line gives the minimum values in the window at each position, from left to right, respectively. The second line gives the maximum values.
Sample Input
8 3
1 3 -1 -3 5 3 6 7
Sample Output
-1 -3 -3 -3 3 3
3 3 5 5 6 7
標簽:
The
two
consists
contains
上傳時間:
2014-12-21
上傳用戶:hongmo
-
Solutions are obtained for Poissson, diffusion, or wave PDEs homogeneous or nonhomogeneous equations and/or boundary conditions rectangular, cylindrical, or spherical coordinates time, Laplace, or frequency domains Dirichlet, Neumann, Robin, singular, periodic, or incoming/outgoing boundary conditions. Output is suitable for pasting into LaTeX documents.
標簽:
nonhomogeneous
homogeneous
Solutions
diffusion
上傳時間:
2015-10-30
上傳用戶:JasonC
-
design LP,HP,B S digital Butterworth and Chebyshev
filter. All array has been specified internally,so user only need to
input f1,f2,f3,f4,fs(in hz), alpha1,alpha2(in db) and iband (to specify
the type of to design). This program output hk(z)=bk(z)/ak(z),k=1,2,...,
ksection and the freq.
標簽:
Butterworth
internally
Chebyshev
specified
上傳時間:
2015-11-08
上傳用戶:253189838
-
% 文件名:randlsbget.m
% 程序員:余波
% 編寫時間:2007.6.25
% 函數功能: 本函數將完成提取隱秘于上的秘密信息
% 輸入格式舉例:result=( scover.jpg ,56, secret.txt ,2001)
% 參數說明:
% output是信息隱藏后的圖象
% len_total是秘密信息的長度
% goalfile是提取出的秘密信息文件
% key是隨機間隔函數的密鑰
% result是提取的信息
function result=randlsbget(output,len_total,goalfile,key)
ste_cover=imread(output)
ste_cover=double(ste_cover)
% 判斷嵌入信息量是否過大
[m,n]=size(ste_cover)
frr=fopen(goalfile, a )
% p作為信息嵌入位計數器將信息序列寫回文本文件
p=1
% 調用隨機間隔函數選取像素點
[row,col]=randinterval(ste_cover,len_toal,key)
for i=:len_toal
if bitand(ste_cover(row(i),col(i)),1)==1
fwrite(frr,1, bit1 )
result(p,1)
else
fwrite(frr,0, bit1 )
result(p,1)=0
end
if p==len_total
break
end
p=p+1
end
fclose(frr)
標簽:
randlsbget
result
scover
2007
上傳時間:
2015-11-10
上傳用戶:yzhl1988
-
的問題.派爾高協議,控制左轉右轉時,出現問題.其他功能好用.我用DELPHI寫的程序,在MOUSEDOWN中, str := chr($FF)+chr($01)+chr($00)+chr($04)+chr($0F)+chr($00)+chr($14)
MSComm1.output := str
在CLICK事件中: str := chr($FF)+chr($01)+chr($00)+chr($00)+chr($00)+chr($00)+chr($01)
MSComm1.output := str
標簽:
chr
MOUSEDOWN
DELPHI
str
上傳時間:
2015-11-20
上傳用戶:Thuan
-
STK500_2下載器 M8 支持bootloader(帶bootloader源碼)
使用STK500_2 協議的ISP下載器,監控芯片 M8,數據通訊RS232.使用
ATMEL AVRStudio 4.xx STK500工具的進行軟件升級。可通過ATMEL
AVRStudio 4.xx STK500工具升級固件程序。升級方法:通過設定電壓
即按“write voltage”按鈕進入bootloader程序。
標簽:
bootloader
STK
500
ISP
上傳時間:
2014-08-27
上傳用戶:haoxiyizhong
-
已知:Sn= 1+1/2+1/3+…+1/n。顯然對于任意一個整數K,當n足夠大的時候,Sn大于K。
現給出一個整數K(1<=k<=15),要求計算出一個最小的n;使得Sn>K。
Input
鍵盤輸入 k
Output
屏幕輸出 n
Sample Input
1
Sample Output
2
Source
標簽:
Sn
整數
上傳時間:
2014-01-25
上傳用戶:ruixue198909
-
這是一個ACM中的題請大家看以下哈
如果有問題請多多指教
n個猴子圍坐一圈并按照順時針方向從1到n編號,從第s個猴子開始進行1到m的報數,報數到第m的猴子
退出報數,從緊挨它的下一個猴子重新開始1到m的報數,如此進行下去知道所有的猴子都退出為止。
求給出這n個猴子的退出的順序表。
Input
有做組測試數據.每一組數據有兩行,第一行輸入n(表示猴子的總數)第二行輸入數據s(從第s
個猴子開
始報數)和數據m(第m個猴子退出報數).當輸入0 0 0時表示程序結束.
Output
輸出中,每組數據的輸出結果為一行,中間用逗號間隔。
標簽:
ACM
家
方向
上傳時間:
2014-01-01
上傳用戶:腳趾頭