[Original] CLRS 4. 2-2
暂无测试数据。
Background
改编自CLRS(算法导论) 练习4. 2-2
Description
给出矩阵\(A,B\),保证其大小为\(2^n\),计算\(A\times B\)
Format
Input
Two integers x and y, satisfying 0 <= x, y <= 32767.
Output
One integer, the sum of x and y.
Sample 1
Input
123 500
Output
623
Limitation
对于所有的测试点,每个测试点提供1GB的内存和15s的时限
对于所有的测试点,有\(2 \leqslant n \leqslant 12\),矩阵内每个元素\(-1000 < x < 1000\)
Hint
Free Pascal Code
var a,b:longint;
begin
readln(a,b);
writeln(a+b);
end.
C Code
#include <stdio.h>
int main(void)
{
int a, b;
scanf("%d%d", &a, &b);
printf("%d\n", a + b);
return 0;
}
C++ Code
#include <iostream>
using namespace std;
int main()
{
int a, b;
cin >> a >> b;
cout << a + b << endl;
return 0;
}
Python Code
a, b = [int(i) for i in raw_input().split()]
print(a + b)
Java Code
import java.io.*;
import java.util.Scanner;
public class Main {
/**
* @param args
* @throws IOException
*/
public static void main(String[] args) throws IOException {
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
int b = sc.nextInt();
System.out.println(a + b);
}
}
Source
Vijos Original
信息
- 难度
- (无)
- 分类
- (无)
- 标签
- (无)
- 递交数
- 0
- 已通过
- 0
- 通过率
- ?
- 上传者