-
-
-
-
-
-
-
-
-
A Bank plans to install a machine for cash withdrawal. The machine is
able to deliver appropriate @ bills for a requested cash amount. The
machine uses exactly N distinct bill denominations, say Dk, k=1,N, and
for each denomination Dk the machine has a supply of nk bills. For
example,
N=3, n1=10, D1=100, n2=4, D2=50, n3=5, D3=10
means the machine has a supply of 10 bills of @100 each, 4 bills of @50
each, and 5 bills of @10 each.
Call cash the requested amount of cash the machine should d ...
阅读题目
问答题
经典指数
-
A substring of a string T is defined as:
T(i, k)=TiTi
+1...Ti+k
-1, 1≤i≤i+k-1≤|T|.
Given two strings A, B and one integer K, we
define S, a set of triples (i, j, k):
S = {(i, j, k) |
k≥K, A(i, k)=B(j, k)}.
You are to give the value of |S| for specific A,
B and K.
输入描述
The input file contains several blocks of data. For each block, the
first line contains one integer K, followed by two lines
containing strings A and B, respectively. The input
file is ended by K=0.
1 ≤ ...
阅读题目
问答题
经典指数