ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#188354 | #3304. 回文 | illness0412 | 100 | 167ms | 1200kb | C++ | 283b | 2023-10-03 08:52:41 | 2023-10-03 12:31:59 |
answer
#include <iostream>
#include <cstdio>
using namespace std;
int main(){
int n, a, odd=0, even=0;
cin >> n;
for(int i=0;i<n;i++){
cin >> a;
odd += a%2;
even += a/2;
}
int ans;
if(odd==0)
ans=even*2;
else
ans=even/odd*2+1;
cout << ans;
return 0;
}
详细
小提示:点击横条可展开更详细的信息
Test #1:
score: 10
Accepted
time: 0ms
memory: 1200kb
input:
2 7699 5087
output:
6393
result:
ok single line: '6393'
Test #2:
score: 10
Accepted
time: 0ms
memory: 1196kb
input:
2 5597 7744
output:
13341
result:
ok single line: '13341'
Test #3:
score: 10
Accepted
time: 0ms
memory: 1196kb
input:
2 9309 4377
output:
6843
result:
ok single line: '6843'
Test #4:
score: 10
Accepted
time: 22ms
memory: 1196kb
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: 24ms
memory: 1196kb
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: 24ms
memory: 1196kb
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: 24ms
memory: 1196kb
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: 25ms
memory: 1200kb
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: 24ms
memory: 1200kb
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: 24ms
memory: 1196kb
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