-
Category : Windows Develop
Tags :
- Update : 2012-11-26
- Size : 758kb
- Downloaded :0次
- Author :skya****
- About :
Nobody
- PS : If download it fails, try it again. Download again for free!
Introduction - If you have any usage issues, please Google them yourself
Problem description:
A given integer m, composed of a vector A,,, and another by the n integers 1 2,,, maa L aia ≤ m 1 ≤ i ≤ m
Vector composed of B,,. Vector between A and B is defined as dist from: 1 2,,, nbb L bib ≤ n 1 ≤ i ≤ n
() (). 1, 1
, Min i m j n i j
dist A B a b
≤ ≤ ≤ ≤
=--
Vector directed away from the issue of the volume of requests to the distance between A and B.
For example, when m = 5, n = 5, corresponding to vector A: (-5,3,-5,2,4), vector B is: (-2,-3,-2,-3,-1)
When, dist (A, B) = 2.
Programming tasks:
For a given integer m, composed of a vector A,,, and another by the n 1 2,,, maa L aia ≤ m 1 ≤ i ≤ m
Integral component of the vector B,,, try to design a O (m+ n) time algorithm, namely 1 2,,, nbb L bib ≤ n 1 ≤ i ≤ n
Directional traffic count to the distance between A and B.
Data entry:
Provided by the input data file input.txt. Line 1 of the document are two positive integers m and n. Line 2 is an integer vector A:
. Line 3 is an integer vector
Packet file list
(Preview for download)
dist_
.....\Debug
.....\.....\dist_.exe
.....\.....\dist_.ilk
.....\.....\dist_.obj
.....\.....\dist_.pch
.....\.....\dist_.pdb
.....\.....\vc60.idb
.....\.....\vc60.pdb
.....\dist.pdf
.....\dist.ppt
.....\dist_.cpp
.....\dist_.dsp
.....\dist_.dsw
.....\dist_.ncb
.....\dist_.opt
.....\dist_.plg
.....\ReadMe.txt
.....\StdAfx.cpp
.....\StdAfx.h
Related instructions
- We are an exchange download platform that only provides communication channels. The downloaded content comes from the internet. Except for download issues, please Google on your own.
- The downloaded content is provided for members to upload. If it unintentionally infringes on your copyright, please contact us.
- Please use Winrar for decompression tools
- If download fail, Try it againg or Feedback to us.
- If downloaded content did not match the introduction, Feedback to us,Confirm and will be refund.
- Before downloading, you can inquire through the uploaded person information