太简单了

#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. 命令创建.net core3.0 web应用详解(超详细教程)

    原文:命令创建.net core3.0 web应用详解(超详细教程) 你是不是曾经膜拜那些敲几行代码就可以创建项目的大神,学习了命令创建项目你也可以成为大神,其实命令创建项目很简单. 1.cmd命令行 ...

  2. .net HttpClient 回传实体帮助类

    public class HttpClientHelper<T> { /// <summary> /// Get请求 返回实体 /// </summary> /// ...

  3. Options of the DB storage of prometheus

    参考: // Options of the DB storage. type Options struct { // The timestamp range of head blocks after ...

  4. Java 之 Set 接口

    一.Set 概述 java.util.Set 接口继承 collection 接口,它与 Collection 接口中的方法基本一致,并没有对 Collection 接口进行功能上的扩充,只是比 Co ...

  5. js 提取特定的时间区间段

    项目中遇到问题,需要根据用户的选择提取出一个时间的区间段,然后对后台进行请求. 基本思路,先根据new Date()对象求出start_time和end_time时间戳,然后把时间戳转化成new Da ...

  6. Springboot+Mybatis的逆向工程

    Mybatis逆向工程,自动生成 entity类和常用的增删改查方法. 1.pom.xml引入类 <!-- 通用mapper 用于mabatis封装的基础增删改查的功能--><dep ...

  7. Docker11-实战-部署多套环境

    目录 创建本地挂载目录 准备一个简单的java web项目 启动Tomcat容器:通过挂载不同的代码目录和运行端口来区分 案例:修改测试环境代码 创建本地挂载目录 在宿主host主机上面创建两个目录, ...

  8. Odoo MRP模块

    转载请注明原文地址:https://www.cnblogs.com/ygj0930/p/10825963.html 一:MRP MRP:产品制造管理. 产品制造业务设计到以下几个关键概念: 1)BOM ...

  9. ElasticSearch(十四):Linux下设置ElasticSearch 开机自启

    一.创建脚本文件 在  /etc/init.d  目录下,创建脚本文件 elasticsearch # cd /etc/init.d/ # vim elasticsearch 将以下内容写入文件中(其 ...

  10. Linux运维技术之NFS网络文件系统

    NFS:网络文件系统,只能工作在Unix/linux之间,不能与windows之间交互. NFS文件系系统只能基于ip来认证! RPC:远程过程调用,简化分布式应用程序的开发, 对Linux系统而言, ...