社区讨论
求钓ce
P1007独木桥参与者 2已保存回复 1
讨论操作
快速查看讨论及其快照的属性,并进行相关操作。
- 当前回复
- 1 条
- 当前快照
- 1 份
- 快照标识符
- @mezj0xm2
- 此快照首次捕获于
- 2025/08/31 18:07 6 个月前
- 此快照最后确认于
- 2025/08/31 18:17 6 个月前
CPP
#include <iostream>
#define int long long int
using namespace std;
int a[114514], _, n, maxn = 0, minn = 0;
template <typename _Tp>
inline const _Tp &
__max(const _Tp &__a, const _Tp &__b)
{
__glibcxx_function_requires(_LessThanComparableConcept<_Tp>)
if (__a < __b) return __b;
return __a;
}
template <typename _Tp>
inline const _Tp &
__min(const _Tp &__a, const _Tp &__b)
{
__glibcxx_function_requires(_LessThanComparableConcept<_Tp>)
if (__b < __a) return __b;
return __a;
}
int main()
{
// freopen(".in","r",stdin);
// freopen(".out","w",stdout);
ios::sync_with_stdio(0);
cin.tie(0);
cin >> _ >> n;
for (int i = 1; i <= n; i++)
{
cin >> a[i];
maxn = __max(maxn, __max(_ + 1 - a[i], a[i]));
minn = __max(minn, __min(_ + 1 - a[i], a[i]));
}
cout << minn << " " << maxn;
return 0;
}
回复
共 1 条回复,欢迎继续交流。
正在加载回复...