Docstoc

De qui

Document Sample
De qui Powered By Docstoc
					BBi 1. NBng 16n lily thiva nhanh vbi di$u kien sau diiy: Khbng Nqp s6 thpc A vh s6 t p nhi&nk. H5y tinh vh in ra duqc phkp sir dpng phep tinh ndng l&n1Oy thira, k vir dd ltm d6 kh8ng th&thyc hi&nk phep nhiin. BBi 2. Cac phep tinh s6 hpc Trong bi&u thirc ((((1?2)?3)?4)?5)?6. H5y thay cbc diu ? bing mat trong cbc phep tinh s6 hoc +, -, *, / sao cho: a. kt qud tinh duqc 1 35 (khi chia phhn d u duqc bo di). 1 b. kt qub tinh duqc c6 gi6 trj ltm nhit. vikt bing hai p h u m g phbp d4 qui va lip. Bii 3. T6ng binh p h w n g C6 th&vikt s6 t p nhi&n M cho truirc dubi dqng t6ng cac binh p h u m g cua hai s6 ty nhi6n hay khbng? HPy vikt c h u m g trinh giai bai toan nay bing p h u m g phap d4 qui va lap.

+ Bhi 4. Ham ~6
Ham s6 F(n) vbi cbc s6 n nguy6n kh8ng bm duqc xac djnh nhu sau: F(O)=O; F(1)= 1; F(2n)=F(n); F(2n+ 1)=F(n)+F(n+ 1) Vtri N cho trubc x6c djnh va in ra F(n) ~ i k ki&n bit buec: N dd 16-11 d&kh6ng thi dGng mdng g6m N ph$n tir (hoac khai u bao mgng co chi& dai tang the0 N).

Bai 5. Loat s6 kh8ng Cho mdng s6 A, hPy tim di, dai cua dly con 1 nhit g6m cbc phhn tir lien tikp toan h s6 kh8ng. vikt bing p h u m g phdp de qui va lap.
.f

Bai 6. T6ng theo t$p con Cho trubc mang s6 nguy6n A vh s6 M. Tim t$p h q cbc ph$n ttir: A[il], A[i2],.. .A[ik]. 1 5 il L i2 5...--< I.. ik .--<in Sao cho A[il]+A[i2]+.. .+A[ik]=M v i i t bing p h u m g phdp de qui. Bai 7. Cai cva Cho trlrCrc mkng X[l :m]. H l y tim da dii ltm nh6t ccda d8y li6n tibp cac s6 "hinh cua" (co rang h u h g l6n tr6n). A[i,] < A[$ > A[i3].. .A[ik] vbi 1 5 i l 5 i2 I.. ik I.. .I .--<in vikt bing p h u m g phip d&qui. Bai 8. Mi? cung va n g v du khach ~ Du khdc c6 th&ra k h b m6 cung duqc hay khbng? N ~ co th8 h i y in d u h g di tir l6i U ra d i n vj tri ban dhu clia du khbch. M6 cung duqc cho biri mang A kich thutrc 40*40, trong do: A[k,m]=O, nku 8 [k,m] di qua duqc (8 th8ng)

A[k,m]= 1, nku 8 [k,m] kh8ng di qua duqc (8 chm). Vi tri ban diu cua du khach duqc cho 6 8 th8ng [ij]. Du khdch c6 thk chuykn tir mijt 8 th8ng nay din 8 th8ng khac nku chung c6 chung canh. Du khlch di ra kh6i m&cung n&uroi vho 8 bi&ngiiri (tirc la 8 [k,m], trong d6 k hoac m bing 1 hoac 40).
Bai 9. Dang t6ng. In tit ca C ~ cdch vikt s6 tq nhicn N duiri dang tang cac s6 tq nhi6n. Vi&cd8i ch8 C cdc s6 hang duqc coi la mGt cach miri. Vi6t bing phumg phap d&qui va lap. Bai 10. KhBng lap lai 3 len H5y tim c L d5y n>=3 s6 0 va s6 1, trong d6 kh8ng c6 d5y con lap lqi 3 ?in b & ntuc. vikt bing phlrmg phap d&qui.
X-

~ i 11. ~ h dcrn di@ukkp i h Mbng s6 hai chi& A, duqc s i p xgP kh8ng giam tir phai qua trdi va tir trin xu6ng duiri. Tim phin tir cda mang bing s6 X cho truirc va in ra chi s6 cua no. In kh8ng n&u khbng c6 phin tir do trong mang. ~ i &ki@nbit buijc: Lbi giii cin c6 dij phirc tap m+n (Chir kh8ng phai m*n). vi&t u bing phumg phdp d&qui va lep. Bai 12. Lang trung tarn C6 K ling, n&utr ling I dat tram chp c h , thi xe ckp cliu di d&nlang j the0 tin higu goi chn thbi gian: A[i,i] + ALij] (1 5 i, j 2 k, i # j) Tim s6 hi@ulang I dd dat tram ckp cliu sao cho tir do tiri ling xa nhkt (v&thbi gian) SO mht thbi gian ngin nhht. Mang hai chi& A[l :k, 1 :k] cho truirc, trong 66 tkt ca phin tir A[i,j]>O va phin tir A[ij] co thk kh8ng bing ph$n tir Afi,i]. Bai 13. L$t nguqc Cho truirc mang s6 A. Tim doan d6i ximg dai nhht cua mang A do (s6 diu ti@n bing s6 cu6i , k g , s6 thir hai bing s6 dimg trlrirc s6 cu6i cung. ..). Hiiy in dij dai cua doan nay. vikt bing p h u m g phap d@ va lap. qui


				
DOCUMENT INFO
Shared By:
Categories:
Tags:
Stats:
views:11
posted:10/19/2009
language:Vietnamese
pages:2