22615_BinaryOperation

2022-5-16 18:22| 发布者: Hocassian| 查看: 22| 评论: 0|原作者: 肇庆学院ACM合集

摘要:
C:\Users\Administrator\Downloads\2019-10-12-10-14-5-89506788217200-Problem List-采集的数据-后羿采集器.html

Pro.ID

22615

Title

Binary Operation

Title链接

http://10.20.2.8/oj/exercise/problem?problem_id=22615

AC

2

Submit

2

Ratio

100.00%

时间&空间限制

  • Time Limit: 2000/1000 MS (Java/Others)     Memory Limit: 65536/65536 K (Java/Others)
  • 描述

    Consider a binary operation defined on digits 0 to 9, such that 0 0 = 0.

    A binary operation is a generalization of to the set of non-negative integers,

    The result of ab is defined in the following way: if one of the numbers a and b has fewer digits than the other in decimal notation, then append leading zeroes to it, so that the numbers are of the same length; then apply the operation digit-wise to the corresponding digits of a and b.

    Let us define to be left-associative, that is, abc is to be interpreted as (ab)c.

    Given a binary operation and two non-negative integers a and b, calculate the value of a(a + 1)(a + 2)...(b - 1)b.

    输入

    The first ten lines of the input file contain the description of the binary operation . The i-th line of the input file contains a space-separated list of ten digits ---  the j-th digit in this list is equal to (i-1)(j-1).

    The first digit in the first line is always 0.

    The eleventh line of the input file contains two non-negative integers a and b ( 0 ≤ ab ≤ 1018 ).

    输出

    Description

    Consider a binary operation defined on digits 0 to 9, such that 0 0 = 0.

    A binary operation is a generalization of to the set of non-negative integers,

    The result of ab is defined in the following way: if one of the numbers a and b has fewer digits than the other in decimal notation, then append leading zeroes to it, so that the numbers are of the same length; then apply the operation digit-wise to the corresponding digits of a and b.

    Let us define to be left-associative, that is, abc is to be interpreted as (ab)c.

    Given a binary operation and two non-negative integers a and b, calculate the value of a(a + 1)(a + 2)...(b - 1)b.

    Input

    The first ten lines of the input file contain the description of the binary operation . The i-th line of the input file contains a space-separated list of ten digits ---  the j-th digit in this list is equal to (i-1)(j-1).

    The first digit in the first line is always 0.

    The eleventh line of the input file contains two non-negative integers a and b ( 0 ≤ ab ≤ 1018 ).

    Output

    Output a single number --- the value of  a(a+1)(a+2)...(b-1)b  without extra leading zeroes.

    Sample Input

    0 1 2 3 4 5 6 7 8 9
    1 2 3 4 5 6 7 8 9 0
    2 3 4 5 6 7 8 9 0 1
    3 4 5 6 7 8 9 0 1 2
    4 5 6 7 8 9 0 1 2 3
    5 6 7 8 9 0 1 2 3 4
    6 7 8 9 0 1 2 3 4 5
    7 8 9 0 1 2 3 4 5 6
    8 9 0 1 2 3 4 5 6 7
    9 0 1 2 3 4 5 6 7 8
    0 10

    Sample Output

    15

    Source

    样例输入

    0 1 2 3 4 5 6 7 8 9
    1 2 3 4 5 6 7 8 9 0
    2 3 4 5 6 7 8 9 0 1
    3 4 5 6 7 8 9 0 1 2
    4 5 6 7 8 9 0 1 2 3
    5 6 7 8 9 0 1 2 3 4
    6 7 8 9 0 1 2 3 4 5
    7 8 9 0 1 2 3 4 5 6
    8 9 0 1 2 3 4 5 6 7
    9 0 1 2 3 4 5 6 7 8
    0 10

    样例输出

    15

    作者


    路过

    雷人

    握手

    鲜花

    鸡蛋

    最新评论

    返回顶部