TopCoder

User's AC Ratio

100.0% (2/2)

Submission's AC Ratio

100.0% (2/2)

Tags

Description

本題請實作 N 位數 aN1aN2a0M 位數 bM1bM2b0 的加法、減法以及乘法。保證運算結果仍為正整數。

Input Format

輸入第一行是三個空白分隔的正整數 N,M,op,分別代表第一和第二個數的位數,以及操作種類。當 op=0 時執行大數加法,當 op=1 時執行減法,當 op=2 時執行乘法。
第二行有一個長度 N 的字串,即 N 為整數。
第二行有一個長度 M 的字串,即 M 為整數。

輸入保證 1N,M10000ai,bi9aN1,bM10

Output Format

輸出一行一個字串表示運算結果,字串不得有前導 0

Sample Input 1

2 3 0
97
594

Sample Output 1

691

Sample Input 2

2 2 1
34
27

Sample Output 2

7

Hints

Problem Source

Subtasks

No. Testdata Range Constraints Score
1 0~1 範例測資 0
2 0~31 無額外限制 100

Testdata and Limits

No. Time Limit (ms) Memory Limit (VSS, KiB) Output Limit (KiB) Subtasks
0 1000 524288 65536 1 2
1 1000 524288 65536 1 2
2 1000 524288 65536 2
3 1000 524288 65536 2
4 1000 524288 65536 2
5 1000 524288 65536 2
6 1000 524288 65536 2
7 1000 524288 65536 2
8 1000 524288 65536 2
9 1000 524288 65536 2
10 1000 524288 65536 2
11 1000 524288 65536 2
12 1000 524288 65536 2
13 1000 524288 65536 2
14 1000 524288 65536 2
15 1000 524288 65536 2
16 1000 524288 65536 2
17 1000 524288 65536 2
18 1000 524288 65536 2
19 1000 524288 65536 2
20 1000 524288 65536 2
21 1000 524288 65536 2
22 1000 524288 65536 2
23 1000 524288 65536 2
24 1000 524288 65536 2
25 1000 524288 65536 2
26 1000 524288 65536 2
27 1000 524288 65536 2
28 1000 524288 65536 2
29 1000 524288 65536 2
30 1000 524288 65536 2
31 1000 524288 65536 2