-->
当前位置:首页 > 题库

PROGRAMMING:Interesting binary

Luz5年前 (2021-05-10)题库319
Given two sequences (sequence a and sequence b), find the * * logarithm * * of the binary $$(x, y) $$satisfying ($$x < = y $$and $$x $$is an element in sequence a and $$y $$is an element in sequence B).
Explanation: different logarithms are defined as two tuples $$(a [i], B [J]) $$and $$(a [k], B [Z]) $$where $$(1 < = I, K < = n, 1 < = J, Z < = m) $$satisfies $$(I= k || j != z) $$;
###Input format:
Two integers n and m in the first line represent the length of sequence a and sequence B respectively (1 < = n, m < = 100000)$$
The next line contains n integers, representing a sequence$$( 0 <= a[i] <= 100000 , 1 <= i <= n )$$
The next line, m integers, represents the b sequence$$( 0 <= b[j] <= 100000 , 1 <= j <= m )$$
###Output format:
Output the binary logarithm satisfying the condition
###Input sample 1:
```in
2 3
1 3
1 2 3
```
###Output sample 1:
```out
four
```
Example explanation: the logarithms satisfying the conditions are (1,1), (1,2), (1,3), (3,3)
###Input sample 2:
```in
2 2
1 1
2 2
```
###Output sample 2:
```out
four
```
Example explanation: the logarithms satisfying the conditions are (1,2), (1,2), (1,2), (1,2)







answer:If there is no answer, please comment