Problem 1930 --Problem C - Sumsets

1930: Problem C - Sumsets

"
Time Limit $1$ 秒/Second(s) Memory Limit $512$ 兆字节/Megabyte(s)
提交总数 $2$ 正确数量 $2$
裁判形式 标准裁判/Standard Judge 我的状态 尚未尝试
难度 分类标签

Problem C - Sumsets

Given S, a set of integers, find the largest d such that a + b + c = d where a, b, c, and d are distinct elements of S.

Several S, each consisting of a line containing an integer 1 <= n <= 1000 indicating the number of elements in S, followed by the elements of S, one per line. Each element of S is a distinct integer between -536870912 and +536870911 inclusive. The last line of input contains 0.

For each S, a single line containing d, or a single line containing "no solution".

5
2 
3 
5 
7 
12
5
2 
16 
64 
256 
1024
0
12
no solution

推荐代码 查看1930 所有题解 上传题解视频得图灵币

本题记录 用 户(点击查看用户) 运行号(点击购买题解) 时 间
算法最快[$98 $ms] 淡意的温柔 589794 2020-06-01 15:04:06
内存最少[$0 $KB] 淡意的温柔 589794 2020-06-01 15:04:06
第一AC AOJ大管家 84445 2017-04-27 15:29:55
第一挑战 AOJ大管家 84445 2017-04-27 15:29:55

赛题来源/所属竞赛 NA N/A

竞赛编号 竞赛名称 竞赛时间 访问比赛