社区讨论

所以......这为啥RE啊

P11213【MX-J8-T1】竹竿参与者 3已保存回复 4

讨论操作

快速查看讨论及其快照的属性,并进行相关操作。

当前回复
4 条
当前快照
1 份
快照标识符
@m2idejl9
此快照首次捕获于
2024/10/21 10:01
去年
此快照最后确认于
2025/11/04 16:39
4 个月前
查看原帖
CPP
#include <bits/stdc++.h>
using namespace std;

int n;
int x,y;
int a[100005];
int op;

int main(){
	scanf("%d",&n);
	for(long long i = 1; i <= n; ++i){
		scanf("%d%d",&x,&y);
		a[++op] = x - y;
		a[++op] = y;
	}
	sort(a + 1,a + op + 1);
	printf("%d",a[op] + a[op - 1]);
	return 0;
}

回复

4 条回复,欢迎继续交流。

正在加载回复...