給定n 個整數a ,a , ,an 1 2 組成的序列, a n i | |£ ,1 £ i £ n。如果對于i £ j ,有
0 = å
=
j
k i
k a ,則稱序列區間i i j a , a , , a +1 為一個零和區間,相應的區間長度為j-i+1。
給定n 個整數a ,a , ,an 1 2 組成的序列, a n i | |£ ,1 £ i £ n。如果對于i £ j ,有
0 = å
=
j
k i
k a ,則稱序列區間i i j a , a , , a +1 為一個零和區間,相應的區間長度為j-i+1。
ACM試題An Easy Problem
Description
As we known, data stored in the computers is in binary form. The problem we discuss now is about the positive integers and its binary form. Given a positive integer I, you task is to find out an integer J, which is the minimum integer greater than I, and the number of 1 s in whose binary form is the same as that in the binary form of I. For example, if "78" is given, we can write out its binary form, "1001110". This binary form has 4 1 s. The minimum integer, which is greater than "1001110" and also contains 4 1 s, is "1010011", i.e. "83", so you should output "83".
MULTIDIMENSIONAL SCALING in matlab by Mark Steyvers 1999
%needs optimization toolbox
%Modified by Bruce Land
%--Data via globals to anaylsis programs
%--3D plotting with color coded groups
%--Mapping of MDS space to spike train temporal profiles as described in
%Aronov, et.al. "Neural coding of spatial phase in V1 of the Macaque" in
%press J. Neurophysiology