- 博客(3)
- 收藏
- 关注
原创 E - 和为给定数
E - 和为给定数 题目 蒜头君给出若干个整数,询问其中是否有一对数的和等于给定的数。 输入格式 第一行输入n,代表有n个整数。(0<n<=10^8) 第二行输入n个整数。(0~200000000) 第三行输入m,代表需要得到的和。(0<=m<=2^30) 输出格式 若存在和为 m的数对,输出两个整数,小的在前,大的在后,中间用单个空格隔开。若有多个数对满足条件,选择数对中较小的数更小的。若找不到符合要求的数对,输出一行"No"。 Sample Input 4 2 5 1 4 6 S
2020-10-29 18:31:04
292
原创 C - Shopaholic
C - Shopaholic Lindsay is a shopaholic. Whenever there is a discount of the kind where you can buy three items and only pay for two, she goes completely mad and feels a need to buy all items in the store. You have given up on curing her for this disease, b
2020-10-29 16:37:25
167
原创 B - Increase and Copy
B - Increase and Copy Initially, you have the array a consisting of one element 1 (a=[1]). In one move, you can do one of the following things: Increase some (single) element of a by 1 (choose some i from 1 to the current length of a and increase ai by one
2020-10-24 10:38:51
134
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人