[Original] CLRS 2-3
暂无测试数据。
Background
改编自CLRS(算法导论) 练习2-3
Description
记
\[P(x) = \sum^n_{k=0}a_kx^k\]
给出\(T\)组\(s\),计算\(P(s)\)的值
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
对于满足数据①的测试点,提供128MB的内存和1s的时限
对于满足数据②的测试点,提供512MB的内存和3 ~ 5s的时限
对于数据①,有\(T \leqslant 100\),\(n \leqslant 1000\),\(P(s) \leqslant 10^{18}\)
对于数据②,有\(T \leqslant 10^7\),\(n \leqslant 10^7\),\(P(s) \leqslant 10^{10^3}\)
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
- 通过率
- ?
- 上传者