Problem 1919 --Problem B: Pairsumonious Numbers

1919: Problem B: Pairsumonious Numbers

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

Problem B: Pairsumonious Numbers

For 10 > N > 2 numbers we form N*(N-1)/2 sums by adding every pair of the numbers. Your task is to find the N numbers given the sums. Each line of input contains N followed by N*(N-1)/2 integer numbers separated by a space. For each line of input, output one line containing N integers in non-descending order such that the input numbers are pairwise sums of the N numbers. If there is more than one solution, any one will do; if there is no solution, print "Impossible".

3 1269 1160 1663
3 1 1 1
5 226 223 225 224 227 229 228 226 225 227
5 216 210 204 212 220 214 222 208 216 210
5 -1 0 -1 -2 1 0 -1 1 0 -1
5 79950 79936 79942 79962 79954 79972 79960 79968 79924 79932
383 777 886
Impossible
111 112 113 114 115
101 103 107 109 113
-1 -1 0 0 1
39953 39971 39979 39983 39989

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

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

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

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