UOJ Logo

NOI.AC

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#214406#2386. 回忆zhengzixuan070ms1404kbC++684b2024-11-18 20:22:042024-11-19 08:31:56

answer

#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
int n, m, cnt1, cnt2, f, a[N], b[N], c[N];
int main(){
	cin >> n;
	m = n * (n - 1) / 2;
	for (int i = 1; i <= m; i++)
		cin >> a[i];
	sort(a + 1, a + m + 1);
	b[1] = a[n - 1] - a[1], b[2] = a[1] - b[1]; 
	for (int i = 2; i < n; i++){
		b[i + 1] = a[i] - b[2];
		if (b[i + 1] < b[i]){
			f = 1;
			break; 
		}
	}
	if (f){
		c[1] = a[m] - a[m - n + 2], c[2] = a[m - n + 2] - c[1];
		for (int i = m - n + 3; i <= m; i++)
			c[m - i + 3] = a[i] - c[2];
		for (int i = 1; i <= n; i++)
			cout << c[i] << ' ';
	}
	else{
		for (int i = 1; i <= n; i++)
			cout << b[i] << ' ';
	}
	return 0;
} 

详细

小提示:点击横条可展开更详细的信息

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 1208kb

input:

5
4 5 9 9 10 13 14 14 15 19

output:

5 -1 6 10 10 

result:

wrong answer Your answer is incorrect.

Test #2:

score: 0
Wrong Answer
time: 0ms
memory: 1212kb

input:

5
5 9 9 10 12 12 13 16 17 17

output:

5 0 9 9 10 

result:

wrong answer Your answer is incorrect.

Test #3:

score: 0
Wrong Answer
time: 0ms
memory: 1208kb

input:

5
10 11 12 13 13 14 15 15 16 17

output:

2 13 4 3 2 

result:

wrong answer Your answer is incorrect.

Test #4:

score: 0
Wrong Answer
time: 0ms
memory: 1224kb

input:

50
9 13 15 20 20 20 21 22 22 26 26 26 27 27 27 28 29 31 31 32 32 33 33 33 33 33 34 34 34 35 35 36 37...

output:

32 -23 36 38 43 43 43 44 45 45 49 49 49 50 50 50 51 52 54 54 55 55 56 56 56 56 56 57 57 57 58 58 59 ...

result:

wrong answer Your answer is incorrect.

Test #5:

score: 0
Wrong Answer
time: 0ms
memory: 1224kb

input:

50
9 11 14 14 16 16 16 18 19 19 21 21 21 21 22 22 23 23 23 23 24 25 25 26 26 26 26 26 26 26 27 27 27...

output:

23 -14 25 28 28 30 30 30 32 33 33 35 35 35 35 36 36 37 37 37 37 38 39 39 40 40 40 40 40 40 40 41 41 ...

result:

wrong answer Your answer is incorrect.

Test #6:

score: 0
Wrong Answer
time: 1ms
memory: 1228kb

input:

50
7 9 12 16 19 21 26 27 29 29 31 33 33 33 34 35 36 36 36 36 37 38 38 38 38 39 39 40 40 40 41 41 42 ...

output:

41 -34 43 46 50 53 55 60 61 63 63 65 67 67 67 68 69 70 70 70 70 71 72 72 72 72 73 73 74 74 74 75 75 ...

result:

wrong answer Your answer is incorrect.

Test #7:

score: 0
Wrong Answer
time: 17ms
memory: 1400kb

input:

300
660422 717145 1052261 1191442 1526558 1583281 1636913 1972029 2028752 2207583 2247577 2427928 25...

output:

13132526 -12472104 13189249 13524365 13663546 13998662 14055385 14109017 14444133 14500856 14679687 ...

result:

wrong answer Your answer is incorrect.

Test #8:

score: 0
Wrong Answer
time: 17ms
memory: 1400kb

input:

300
1719032 1728175 1968715 2265775 2506315 2515458 2534303 2752316 3002166 3035709 3071903 3081046 ...

output:

10923289 -9204257 10932432 11172972 11470032 11710572 11719715 11738560 11956573 12206423 12239966 1...

result:

wrong answer Your answer is incorrect.

Test #9:

score: 0
Wrong Answer
time: 16ms
memory: 1404kb

input:

300
725653 809390 819383 974701 984694 1058923 1068431 1068916 1152653 1317964 1422171 1432164 15159...

output:

10011856 -9286203 10095593 10105586 10260904 10270897 10345126 10354634 10355119 10438856 10604167 1...

result:

wrong answer Your answer is incorrect.

Test #10:

score: 0
Wrong Answer
time: 19ms
memory: 1400kb

input:

300
2355315 3132486 3240117 3325566 3662015 3854305 3961936 4047385 4053636 4142315 4383834 4725290 ...

output:

12079982 -9724667 12857153 12964784 13050233 13386682 13578972 13686603 13772052 13778303 13866982 1...

result:

wrong answer Your answer is incorrect.