Educational Codeforces Round 39 A Partition
传送门
分治就好了,哈哈大于小于0的数据分开算
#include <bits/stdc++.h> using namespace std; typedef long long ll ; typedef double dl ; #define INF 0x7fconst int inf = 987654321; const int sz = 1e6 + 5; const int mod = 1e9 + 7; const int sqrtn = 300;#define f(i,l,r) for(int i=l;i<=r;++i) #define g(i,l,r) for(int i=l;i>=r;--i) #define CLR(arr,val) memset(arr,val,sizeof(arr)) #define sz(a) strlen(a) #define FAST_IO ios::sync_with_stdio(false);cin.tie(0);#define lowbit(x) x&(-x) #define X first #define Y second #define pb push_back #define pii pair<int,int>int dir[8][2]={{1,0},{-1,0},{0,1},{0,-1},{1,1},{1,-1},{-1,1},{-1,-1}}; int n; int a ,mx,mn; void work() {cin>>n;f(i,1,n){cin>>a;if(a>0)mx+=a;else mn+=a;}cout<<mx-mn<<endl; }int main() {FAST_IO ;freopen("in","r",stdin);freopen("out","w",stdout);work();return 0; }
转载于:https://www.cnblogs.com/corx/p/8523829.html
Educational Codeforces Round 39 A Partition相关推荐
- Educational Codeforces Round 39 B Weird Subtraction Process
传送门 模拟,写的比较土,别吐槽 #include <bits/stdc++.h> using namespace std; typedef long long ll ; typedef ...
- Educational Codeforces Round 39 G Almost Increasing Array
传送门 非减子序列 普通lcs Dp TLE ,换成upper_bound 竟然过了,神奇 #include <bits/stdc++.h> using namespace std; ty ...
- Educational Codeforces Round 39 F Largest Beautiful Number
传送门 暴力DP dp[i][j][k] 从j 到 k 发f(x) 的大小, #include <bits/stdc++.h> using namespace std; typedef l ...
- Educational Codeforces Round 90 (Rated for Div. 2)(A, B, C, D, E)
Educational Codeforces Round 90 (Rated for Div. 2) Donut Shops 思路 分三种情况: a==c/ba == c / ba==c/b这个时候两 ...
- Educational Codeforces Round 24 E. Card Game Again(双指针)
题目链接:Educational Codeforces Round 24 E. Card Game Again 题意: 给你n个数和一个数k. 现在每次可以拿掉前x个数,后y个数,剩下的数的乘积要能被 ...
- Educational Codeforces Round 113 (Rated for Div. 2) ABCD 解题思路
Educational Codeforces Round 113 (Rated for Div. 2) 经典卡CCC秒DDD,可惜了 怪自己特判写错了吧,对式子找了半天问题结果根本不是式子的问题 A ...
- [Educational Codeforces Round 16]A. King Moves
[Educational Codeforces Round 16]A. King Moves 试题描述 The only king stands on the standard chess board ...
- Educational Codeforces Round 114 (Rated for Div. 2) (A ~ F)全题解
整理的算法模板合集: ACM模板 点我看算法全家桶系列!!! 实际上是一个全新的精炼模板整合计划 Educational Codeforces Round 114 (Rated for Div. 2) ...
- Educational Codeforces Round 106 (Rated for Div. 2)(A ~ E)题解(每日训练 Day.16 )
整理的算法模板合集: ACM模板 点我看算法全家桶系列!!! 实际上是一个全新的精炼模板整合计划 目录 Educational Codeforces Round 106 (Rated for Div. ...
最新文章
- 可与教科书相媲美的书——《世界是数字的》
- 借助Docker单机秒开数十万TCP连接
- Linux下设置主机的FQDN
- firefox启动很慢 linux_Win10安装和使用Linux子系统(WSL 2)完整指南
- Weaveworks增加发布自动化和事件管理
- 19【推荐系统10】从POLY2、FM到FFM——自动特征交叉的解决方案
- 用css实现图片翻转
- 佳能微单R6断电DAT文件MP4视频完美修复不卡顿
- 2018.12.15【NOIP提高组】模拟B组 jzoj100047. 基因变异
- 为什么有机棉这么贵,还深受欢迎?
- 使用随机森林填补缺失值
- 上海市出租车预约叫车和投诉电话一览
- 应用楼宇自控系统降低建筑物设备成本
- 【最新】智慧图书馆管理软件应该全面考量各个模块的建设
- 信号与系统、数字信号处理、滤波、傅里叶变换、数字信号模拟信号采样信号、滤波器零阶保持器
- 使用pandas-alive对“2022年冬奥运奖牌信息“可视化
- 【转帖】SBO05B数据表
- (附源码)计算机毕业设计ssm 个人资金账户管理
- linux安装软件时Stuck at 0% [waiting for headers]错误
- 车间设备信息管理系统c语言,《车间刀具管理系统(全套图纸)》.doc
热门文章
- 计算机vf知识点总结,计算机等级考试二级VF常用函数总结
- oracle分区键使用教程,Oracle表分区学习笔记
- ros melodic控制真实机械臂之urdf模型生成
- python实现GBDT算法的回归、二分类以及多分类,算法流程解读并可视化
- linux内核设计与实现 epub_mongodb内核源码设计实现、性能优化、最佳运维系列-网络传输层模块源码实现四...
- threejs 纹理流动_ThreeJs 认识纹理
- python的networkx 算法_python图算法库Networkx笔记 - Node and Centrality
- Android仿人人客户端(v5.7.1)——对从服务器端(网络)获取的图片进行本地双缓存处理(流程图或活动图)...
- [HTML5]使用Box2dWeb模拟飞行箭矢
- Windows 8 Directx 开发学习笔记(三)摄像机设置及控制正方体旋转