- 羽毛
- 2015-02-03 10:01:51 @
评测结果
编译成功
测试数据 #0: Accepted, time = 0 ms, mem = 556 KiB, score = 10
测试数据 #1: Accepted, time = 0 ms, mem = 556 KiB, score = 10
测试数据 #2: Accepted, time = 15 ms, mem = 552 KiB, score = 10
测试数据 #3: Accepted, time = 0 ms, mem = 560 KiB, score = 10
测试数据 #4: Accepted, time = 0 ms, mem = 552 KiB, score = 10
测试数据 #5: Accepted, time = 15 ms, mem = 552 KiB, score = 10
测试数据 #6: Accepted, time = 0 ms, mem = 556 KiB, score = 10
测试数据 #7: WrongAnswer, time = 0 ms, mem = 556 KiB, score = 0
测试数据 #8: WrongAnswer, time = 15 ms, mem = 552 KiB, score = 0
测试数据 #9: WrongAnswer, time = 0 ms, mem = 556 KiB, score = 0
WrongAnswer, time = 45 ms, mem = 560 KiB, score = 70
代码
#include <cstdio>
#include <cmath>
#include <string>
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int n,a[20005],c1;
int s=0;
int mx=-1;
int abs (int x){
if (x<0)
return -x;
return x;
}
int main (){
scanf ("%d",&n);
int i;
for (i=1;i<=n;i++)
scanf ("%d",&a[i]);
a[0]=a[n];
for (i=0;i<n;i++){
if (abs(a[i+1]-a[i])>mx)
mx=abs(a[i+1]-a[i]);
s+=a[i];
}
c1=ceil(s/(n/2));
printf ("%d",max(c1,mx)+1);
return 0;
}
哪错了???????
2 条评论
-
chenshaoqian LV 8 @ 2016-08-07 06:02:32
喂你个头
-
2015-02-17 09:35:08@
没有人吗
orz
- 1