太简单了

#include <stdio.h>
#include <memory.h>
#include <math.h>
#include <string>
#include <vector>
#include <set>
#include <stack>
#include <queue>
#include <algorithm>
#include <map> #define I scanf
#define OL puts
#define O printf
#define F(a,b,c) for(a=b;a<c;a++)
#define FF(a,b) for(a=0;a<b;a++)
#define FG(a,b) for(a=b-1;a>=0;a--)
#define LEN 100000
#define MAX 0x06FFFFFF
#define V vector<int> using namespace std; int a[LEN];//1e6 int main(){
freopen("d:/input/A1113/2.txt","r",stdin);
int i=,n;
scanf("%d",&n);
while(i<n){
scanf("%d",&a[i]);
i++;
}
int sl=,sr=;
int mid=n/;//[0,mid),[mid,n)
sort(a,a+n);
FF(i,mid) sl+=a[i];
F(i,mid,n) sr+=a[i];
O("%d %d",n%,abs(sl-sr));
return ;
}

A1113 | Integer Set Partition (25)的更多相关文章

  1. PAT A1113 Integer Set Partition (25 分)——排序题

    Given a set of N (>1) positive integers, you are supposed to partition them into two disjoint set ...

  2. A1113. Integer Set Partition

    Given a set of N (> 1) positive integers, you are supposed to partition them into two disjoint se ...

  3. 1113. Integer Set Partition (25)

    Given a set of N (> 1) positive integers, you are supposed to partition them into two disjoint se ...

  4. PAT甲级——A1113 Integer Set Partition

    Given a set of N (>) positive integers, you are supposed to partition them into two disjoint sets ...

  5. PAT (Advanced Level) 1113. Integer Set Partition (25)

    简单题. #include<cstdio> #include<cstring> #include<cmath> #include<vector> #in ...

  6. 【PAT甲级】1113 Integer Set Partition (25分)

    题意: 输入一个正整数N(2<=N<=1e5),接着输入N个正整数,将这些数字划分为两个不相交的集合,使得他们的元素个数差绝对值最小且元素和差绝对值最大. AAAAAccepted cod ...

  7. PAT_A1113#Integer Set Partition

    Source: PAT A1113 Integer Set Partition (25 分) Description: Given a set of N (>) positive integer ...

  8. PAT1113: Integer Set Partition

    1113. Integer Set Partition (25) 时间限制 150 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue ...

  9. 1113 Integer Set Partition (25 分)

    1113 Integer Set Partition (25 分) Given a set of N (>1) positive integers, you are supposed to pa ...

随机推荐

  1. opencv imshow plt imshow

    opencv官方文档上写的,https://docs.opencv.org/master/dc/d2e/tutorial_py_image_display.html Color image loade ...

  2. OpenGL学习 (一) - 简单窗口绘制

    一.OpenGL 简介 OpenGL 本质: OpenGL(Open Graphics Library),通常可以认为是API,其包含了一系列可以操作图形.图像的函数.但深究下来,它是由Khronos ...

  3. 使用php函数防止SQL注入方法

    什么是SQL注入? SQL注入是指在你系统防御之外,某人将一段Mysql语句注入到你的数据库.注入通常发生在系统要求用户输入数据的时候,比如用户名的输入,用户可能输入的不是一个用户名,而是一段SQL语 ...

  4. 获取Excel

    默认Excel文档为 代码如下   需要下载  "EPPlus.Core" var file = Directory.GetCurrentDirectory() + "\ ...

  5. python 中 try,except,finally 的执行顺序

    写代码的时候发现了好玩的事情,常常作为终止的 return 语句并不总是能够立刻跳出函数 def A(): try: for i in range(10): if i == 5: return pri ...

  6. 安装多个jdk导致eclipse打不开问题

    问题描述 本来使用的是jdk1.8,由于其他原因需要使用jdk1.6,在安装完jdk1.6后打开eclipse就会报错: Version 1.6.0_43 of the JVM is not suit ...

  7. 【转载】C#使用InsertRange方法往ArrayList集合指定位置插入另一个集合

    在C#的编程开发中,ArrayList集合是一个常用的非泛型类集合,ArrayList集合可存储多种数据类型的对象.在实际的开发过程中,我们可以使用InsertRange方法在ArrayList集合指 ...

  8. 前端工程师拿到全新的 Mac 需要做哪些准备

    最近苹果退出了新款 Mac,用了3年15款Pro之后,终于盼到18款的降价,于是含泪更新换代 但是每次换电脑,重装环境的好多东西记不清,于是记个笔记 一.终端 安装 zsh sh -c "$ ...

  9. linux mysql连接

    1. 添加头文件 # apt-get install libmysqlclient-dev 引入头文件 #include <mysql/mysql.h> 2. 举例 MYSQL *mysq ...

  10. Ubuntu下 安卓 adb 命令报:“insufficient permissions for device: user in plugdev group; ”问题的解决办法

    https://blog.csdn.net/freezingxu/article/details/80893025 在接入设备进行联机调试的时候,遇到了这样的问题: insufficient perm ...