UOJ Logo

NOI.AC

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#188342#3304. 回文yy10044ms1580kbC++11367b2023-10-03 08:50:012023-10-03 12:31:15

answer

#include<bits/stdc++.h>
using namespace std;
int n, ans1, ans2, sum, a[100001]; 
int main()
{
	scanf("%d",&n);
	for(int i=1;i<=n;i++)
	{
		scanf("%d",&a[i]);
		sum+=a[i];
		ans1+=a[i]/2;
		ans2+=a[i]%2;
	}
	if(!ans2)
	{
		printf("%d",sum);
		return 0;
	}
	if(!ans1)
	{
		printf("1");
		return 0;
	}
	printf("%d",ans1/ans2*2+1);
	return 0;
}

详细

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

Test #1:

score: 10
Accepted
time: 0ms
memory: 1188kb

input:

2
7699 5087

output:

6393

result:

ok single line: '6393'

Test #2:

score: 10
Accepted
time: 0ms
memory: 1188kb

input:

2
5597 7744

output:

13341

result:

ok single line: '13341'

Test #3:

score: 10
Accepted
time: 0ms
memory: 1188kb

input:

2
9309 4377

output:

6843

result:

ok single line: '6843'

Test #4:

score: 10
Accepted
time: 9ms
memory: 1580kb

input:

100000
3505 3375 4677 5243 7869 8383 2393 4047 9603 337 2818 6171 2015 5763 6303 9983 8775 1145 2887...

output:

5207

result:

ok single line: '5207'

Test #5:

score: 10
Accepted
time: 0ms
memory: 1580kb

input:

100000
2150 1073 1789 7189 2755 243 6181 5607 4983 1737 3783 6841 6715 7374 7565 3755 8835 2429 4805...

output:

7337

result:

ok single line: '7337'

Test #6:

score: 10
Accepted
time: 6ms
memory: 1580kb

input:

100000
6668 2936 2266 9802 3476 9056 1342 5335 3100 363 5030 9208 5592 6232 2804 80 2338 3644 2454 8...

output:

45693

result:

ok single line: '45693'

Test #7:

score: 10
Accepted
time: 5ms
memory: 1576kb

input:

100000
2438 9042 3116 1190 1428 2084 5970 3154 8290 9100 7112 3965 4946 6624 6926 4854 4540 5666 629...

output:

91885

result:

ok single line: '91885'

Test #8:

score: 10
Accepted
time: 7ms
memory: 1576kb

input:

100000
4625 2085 8583 8181 8167 8611 6907 1647 5809 9365 9593 7486 5757 7185 847 6905 7867 1077 6300...

output:

5793

result:

ok single line: '5793'

Test #9:

score: 10
Accepted
time: 8ms
memory: 1580kb

input:

100000
8894 9904 8956 6778 9988 318 6594 7212 2074 6784 4550 1838 9762 7032 60 7650 7974 6568 4206 2...

output:

500221672

result:

ok single line: '500221672'

Test #10:

score: 10
Accepted
time: 9ms
memory: 1580kb

input:

100000
5171 5175 8213 5699 537 6981 6257 2225 2166 9789 6935 9411 5123 1503 790 1409 293 4583 2949 1...

output:

5661

result:

ok single line: '5661'

Extra Test:

score: 0
Extra Test Passed