0
点赞
收藏
分享

微信扫一扫

2.7(Sum is K)

小龟老师 2022-02-07 阅读 47
c++

https://acs.jxnu.edu.cn/problem/NOIOPJENGLISH15

描述:

Given a sequence of N numbers. Find different numbers A and B in the sequence so that the sum of A and B equals to K.

输入:

First line: two positive integers N (N <= 1000) and K (K <= 1000000).
Second line: N positive integers (<= 1000000).

输出:

Two integers A and B.

样例输入:

5 12
2 4 7 3 9

样例输出:

3 9

翻译:

描述:

给一组N个数字。发现不同的数字A和B在这组数字中使得A和B的总和为K。

输入:

第一行:两个正整数N和K。(N <= 1000)(K <= 1000000)。

第二行:N个正整数(<= 1000000)。

输出:
两个数字A和B。

样例输入:

5 12
2 4 7 3 9

样例输出:

3 9
举报

相关推荐

0 条评论