【PAT】1113. Integer Set Partition
来源:互联网 发布:java适配器模式实例 编辑:程序博客网 时间:2024/05/17 22:42
#define LOCAL#include <iostream>#include <cstdio>#include <cstring>#include <algorithm>#include <cmath>#include <string>#include <vector>#include <map>#include <set>#include <queue>#include <stack>#define FOR(i, x, y) for(int i = x; i <= y; i++)#define rFOR(i, x, y) for(int i = x; i >= y; i--)#define MAXN 100010#define oo 0x3f3f3f3fusing namespace std;int a[MAXN];int main(){ #ifdef LOCAL freopen("data.in","r",stdin); freopen("data.out","w",stdout); #endif // LOCAL int n;int sum=0; scanf("%d",&n); FOR(i,0,n-1) { scanf("%d",&a[i]); sum+=a[i]; } sort(a,a+n); int ans=0; FOR(i,0,n/2-1) { ans+=a[i]; } int flag=n%2==0?0:1; printf("%d %d",flag,sum-ans*2); return 0;}
0 0
- PAT--1113. Integer Set Partition
- pat 1113. Integer Set Partition
- PAT|1113. Integer Set Partition
- 【PAT】1113. Integer Set Partition
- pat 1113. Integer Set Partition (25)
- 1113. Integer Set Partition (25) PAT 甲级
- PAT 甲级 1113. Integer Set Partition (25)
- 1113. Integer Set Partition
- 1113. Integer Set Partition
- solution Of Pat 1113. Integer Set Partition (25)
- 1113. Integer Set Partition (25)-PAT甲级真题
- PAT - 甲级 - 1113. Integer Set Partition (25) (排序)
- pat 甲1113. Integer Set Partition(排序水题)
- 【PAT】【Advanced Level】1113. Integer Set Partition (25)
- PAT A1113. Integer Set Partition (25)
- PAT A1113 integer set partition (25)
- 1113. Integer Set Partition (25)
- 1113. Integer Set Partition (25)
- 获取到listView的高度
- 拉格朗日乘子法及KKT条件证明
- MySQL进阶漂流记(六)
- Openfiler 创建NAS存储
- Browser对象
- 【PAT】1113. Integer Set Partition
- codevs1099 字串变换(bfs)
- SpringMVC-学习笔记(1)——理解MVC及快速入门
- 1103. Integer Factorization (30)[递归遍历+剪枝]
- 试着用React写项目-利用react-router解决跳转路由等问题(二)
- qt响应键盘事件
- Linux 搭建svn
- Unity代码设置"Standard (Specular setup)"的渲染模式(RenderingMode)
- MyBatis之一对一关联查询