Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
121010 | 刘嘉乐 | 幽灵粒子 | C++ | 通过 | 100 | 1 MS | 260 KB | 281 | 2024-01-21 14:48:01 |
#include<iostream> using namespace std; int a[5005]; int main(){ int n,l; cin>>n>>l; l++; int shs = 0,los = 0; for(int i=1;i<=n;i++){ int yt; cin>>yt; shs = max(shs,min(yt,l-yt)); los = max(los,max(yt,l-yt)); } cout<<shs<<" "<<los<<endl; return 0; }