太简单了

  1. #include <stdio.h>
  2. #include <memory.h>
  3. #include <math.h>
  4. #include <string>
  5. #include <vector>
  6. #include <set>
  7. #include <stack>
  8. #include <queue>
  9. #include <algorithm>
  10. #include <map>
  11.  
  12. #define I scanf
  13. #define OL puts
  14. #define O printf
  15. #define F(a,b,c) for(a=b;a<c;a++)
  16. #define FF(a,b) for(a=0;a<b;a++)
  17. #define FG(a,b) for(a=b-1;a>=0;a--)
  18. #define LEN 100000
  19. #define MAX 0x06FFFFFF
  20. #define V vector<int>
  21.  
  22. using namespace std;
  23.  
  24. int a[LEN];//1e6
  25.  
  26. int main(){
  27. freopen("d:/input/A1113/2.txt","r",stdin);
  28. int i=,n;
  29. scanf("%d",&n);
  30. while(i<n){
  31. scanf("%d",&a[i]);
  32. i++;
  33. }
  34. int sl=,sr=;
  35. int mid=n/;//[0,mid),[mid,n)
  36. sort(a,a+n);
  37. FF(i,mid) sl+=a[i];
  38. F(i,mid,n) sr+=a[i];
  39. O("%d %d",n%,abs(sl-sr));
  40. return ;
  41. }

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. 象棋中“车”的攻击范围_C#

    如题: var a = new String[8,8]; int h, l; Console.WriteLine("输入车所在的行(0-7):"); h = int.Parse(C ...

  2. Spring Web MVC框架简介

    Web MVC framework框架 Spring Web MVC框架简介 Spring MVC的核心是`DispatcherServlet`,该类作用非常多,分发请求处理,配置处理器映射,处理视图 ...

  3. C#控制IIS动态添加删除网站

    我的目的是在Winform程序里面,可以直接启动一个HTTP服务端,给下游客户连接使用. 查找相关技术,有两种方法: 1.使用C#动态添加网站应用到IIS中,借用IIS的管理能力来提供HTTP接口.本 ...

  4. 【SQL】各取所需 | SQL JOIN连接查询各种用法总结

    前面 在实际应用中,大多的查询都是需要多表连接查询的,但很多初学SQL的小伙伴总对各种JOIN有些迷糊.回想一下,初期很长一段时间,我常用的似乎也就是等值连接 WHERE 后面加等号,对各种JOIN也 ...

  5. 浅谈Object.prototype.toString.call()方法

    在JavaScript里使用typeof判断数据类型,只能区分基本类型,即:number.string.undefined.boolean.object.对于null.array.function.o ...

  6. Springboot2 jpa druid多数据源

    package com.ruoyi; import org.mybatis.spring.annotation.MapperScan; import org.springframework.beans ...

  7. setsockopt()函数使用

    closesocket(一般不会立即关闭而经历TIME_WAIT的过程)后想继续重用该socket BOOL bReuseaddr=TRUE; setsockopt (s,SOL_SOCKET ,SO ...

  8. k8s的常用命令(一)

    常用的kubectl命令   kubectl run kubia --image=luksa/kubia --port=8080 --generator=run/v1   --image 指定镜像 - ...

  9. nmap使用流程

    ip为案列 利用ipconfig 测得本地ip为  192.00.00.100 利用-sn探测一批主机内的存活主机 存活主机ip为    192.000.00.1   192.000.00.100 使 ...

  10. JS实现俄罗斯方块

    在80后.90后的儿时记忆里,俄罗斯方块是必备的消遣小游戏,它的玩法非常简单基本大家都懂,但如何用编程语言开发一款儿时同款「俄罗斯方块」,恐怕知道的同学就很少啦. 位置掩码和旋转掩码 俄罗斯方块游戏中 ...