| 记录编号 | 83635 | 评测结果 | AAAAAAAAAA | ||
|---|---|---|---|---|---|
| 题目名称 | 1449.[USACO Mar]参加考试 | 最终得分 | 100 | ||
| 用户昵称 | 是否通过 | 通过 | |||
| 代码语言 | C++ | 运行时间 | 0.005 s | ||
| 提交时间 | 2013-12-04 22:14:32 | 内存使用 | 0.35 MiB | ||
#include<fstream>
#include<algorithm>
using namespace std;
ifstream fi("teststr.in");
ofstream fo("teststr.out");
int tru[10001]={0};
int ans=0;
int n,k;
int main(){
	fi>>n>>k;
	for(int i=1;i<=k;i++){
		fi>>tru[i];
	}
	sort(tru+1,tru+1+k);
	for(int i=2;i<=k;i++){
		ans=max(tru[i]-tru[i-1],ans);
	}
	ans/=2;
	ans=max(ans,tru[1]);
	ans=max(ans,n-tru[k]);//details all r in cstdio's report of solution 
	fo<<ans<<endl;//hia hia
	return 0;//cool
}