21735_A+B

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

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

Pro.ID

21735

Title

A+B

Title链接

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

AC

0

Submit

0

Ratio

-

时间&空间限制

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

    The Research Institute of Given Strings (RIGS) is a well-known place where people investigate anything about strings. Peter works in the department of string operations of RIGS. His department invents different ways to add, multiply, divide strings and even to take logarithm of string based on another one.

    Peter's task is to invent an operation of sum of two given strings. The current Peter's proposal allows to add only strings of the same length n. To do this, Peter takes the set of all strings of length n over a fixed alphabet. Then Peter sorts all taken strings, thus obtaining a sorted sequence of strings T. Let's denote the length of T as M, and enumerate the elements of this sequence as T0, T1 ... TM-1. Now Peter says that the sum of two strings A = Ta and B = Tb is a string C = Tc where c = (a + b) mod M.

    Your task is to find the sum of two given strings A and B over the alphabet of small English letters.

    输入

    The input file consists of two lines containing strings A and B of the same length. Both strings consist of small letters of English alphabet. The length of each string doesn't exceed 100000.

    输出

    Description

    The Research Institute of Given Strings (RIGS) is a well-known place where people investigate anything about strings. Peter works in the department of string operations of RIGS. His department invents different ways to add, multiply, divide strings and even to take logarithm of string based on another one.

    Peter's task is to invent an operation of sum of two given strings. The current Peter's proposal allows to add only strings of the same length n. To do this, Peter takes the set of all strings of length n over a fixed alphabet. Then Peter sorts all taken strings, thus obtaining a sorted sequence of strings T. Let's denote the length of T as M, and enumerate the elements of this sequence as T0, T1 ... TM-1. Now Peter says that the sum of two strings A = Ta and B = Tb is a string C = Tc where c = (a + b) mod M.

    Your task is to find the sum of two given strings A and B over the alphabet of small English letters.

    Input

    The input file consists of two lines containing strings A and B of the same length. Both strings consist of small letters of English alphabet. The length of each string doesn't exceed 100000.

    Output

    Output the sum of strings A and B.

    Sample Input

    Sample #1
    neerc
    neerc


    Sample #2
    z
    y

    Sample Output

    Sample #1
    aijie

    Sample #2
    x

    Source

    样例输入

    Sample #1
    neerc
    neerc


    Sample #2
    z
    y

    样例输出

    Sample #1
    aijie

    Sample #2
    x

    作者


    路过

    雷人

    握手

    鲜花

    鸡蛋

    最新评论

    返回顶部