ACM试题Problem K:Ones
Description
Given any integer 0 <= n <= 10000 not divisible by 2 or 5, some multiple of n is a number which in decimal notation is a sequence of 1 s. How many digits are in the smallest such a multiple of n?
Reducer: Given a dataset and a file containing a reduct, this program outputs a new dataset containing only the attributes appearing in the reduct file.
% binomial.m by David Terr, Raytheon, 5-11-04, from mathworks.com
% Given nonnegative integers n and m with m<=n, compute the
% binomial coefficient n choose m.
The project Adventure is a simple text-based adventure game. The game, as given, involves the hero trying to find his way from a deep dark forest to home and his true love. There s very little else the player can do apart from moving from place to place. It s not really very interesting.
This proje ...
Problem Statement
You are given a string input. You are to find the longest substring of input such that the reversal of the substring is also a substring of input. In case of a tie, return the string that occurs earliest in input.
Definition
Class: ReverseSubstring
Method: findReversed
Parameter ...
This code converts a Galois Field array created usin GF(2^m) for a given primitive polynomial into a decimal array that can be used within typical .m file coding.
Distribution generator
Here is a simple generator which can build some distributions with given properties.
Distributions generator (compile with -lm)
Typical use might be:
./distributions -u -m 1 -M 10 -n 100 -s 500
Generates a distribution of 100 uniform random numbers between 1 and 10, such that ...
HDOJ ACM
input:The input consists of T test cases. The number of test cases ) (T is given in the first line of the input. Each test case begins with a line containing an integer N , 1<=N<=200 , that represents the number of tables to move. Each of the following N lines contains two positive integers ...