Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
121100 | 张泽辰 | 幽灵粒子 | C++ | 通过 | 100 | 1 MS | 240 KB | 252 | 2024-01-21 15:15:52 |
#include <bits/stdc++.h> using namespace std; int main(){ int n,l,max_=0,min_=0; cin>>n>>l; for(int i=1,temp;i<=n;i++) { cin>>temp; max_=max(max_,max(l-temp+1,temp)); min_=max(min_,min(l-temp+1,temp)); } cout<<min_<<" "<<max_; }