1013A.Piles With Stones
#include<iostream>
using namespace std;
int main(){
int n,x;
int sum1=,sum2=;
cin>>n;
for(int i=;i<n;i++){
cin>>x;
sum1+=x;
}
for(int i=;i<n;i++){
cin>>x;
sum2+=x;
}
if(sum1<sum2)
cout<<"NO"<<endl;
else
cout<<"YES"<<endl;
return ;
}
题目解析:很长的题目就是说给出n堆石头,再给出两组石头堆的石头数量情况,对第一组有“取走”和“移动”两种操作,次数无限,问能否变成第二组的情况。
1013A.Piles With Stones的更多相关文章
- HDU 5973 Game of Taking Stones 威佐夫博弈+大数
题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=5973 Game of Taking Stones Time Limit: 2000/1000 MS ...
- [LeetCode] Minimum Cost to Merge Stones 混合石子的最小花费
There are N piles of stones arranged in a row. The i-th pile has stones[i] stones. A move consists ...
- [Swift]LeetCode1000. 合并石头的最低成本 | Minimum Cost to Merge Stones
There are N piles of stones arranged in a row. The i-th pile has stones[i] stones. A move consists ...
- [ICPC 北京 2017 J题]HihoCoder 1636 Pangu and Stones
#1636 : Pangu and Stones 时间限制:1000ms 单点时限:1000ms 内存限制:256MB 描述 In Chinese mythology, Pangu is the fi ...
- icpc 2017北京 J题 Pangu and Stones 区间DP
#1636 : Pangu and Stones 时间限制:1000ms 单点时限:1000ms 内存限制:256MB 描述 In Chinese mythology, Pangu is the fi ...
- 1000. Minimum Cost to Merge Stones
There are N piles of stones arranged in a row. The i-th pile has stones[i] stones. A move consists ...
- 【2017 ICPC亚洲区域赛北京站 J】Pangu and Stones(区间dp)
In Chinese mythology, Pangu is the first living being and the creator of the sky and the earth. He w ...
- IEEEXtreme 10.0 - Game of Stones
这是 meelo 原创的 IEEEXtreme极限编程大赛题解 Xtreme 10.0 - Game of Stones 题目来源 第10届IEEE极限编程大赛 https://www.hackerr ...
- hdu 5973 Game of Taking Stones(大数,bash game¥)
Game of Taking Stones Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Ot ...
随机推荐
- kubernter相关内容
1. Kubernetes 第一章:互联网架构的演变 随着1946年世界上第一台电子计算机的问世网络就随之出现了,只不过当初只是为了解决多个终端之间的连接,这就是局域网的雏形.后来,随着美国国防部高级 ...
- 洛谷 P1504 积木城堡
题目传送门 解题思路: 01背包. AC代码: #include<iostream> #include<cstdio> #include<vector> using ...
- C++ STD Gems06
generate.generate_n.sample.iota #include <iostream> #include <vector> #include <strin ...
- python格式字符
- Python模拟登录哔哩哔哩
嘿,各位小伙伴中午好呀,今天要带来点什么干货呢,就从我的实际开发中来给大家带来一个案例吧,如何自动登录哔哩哔哩. ! 接到老大通知,让我自动写一个自动登录哔哩哔哩的脚本,我当然是二话不说直接开怼,咱们 ...
- php base64编码图片上传七牛
上网上找了好几个例子 都是自己写curl上传 感觉七牛这么多年了不应该sdk不提供一个方法 然后试 试 试 显示put 方式 上传上去 就是个字符串 后来换成文件上传方法 putFile 成了 不废话 ...
- web.xml中filter加载顺序出现的问题
刚刚遇到了一个问题,项目中需要用到characterEncodingFilter和HiddenHttpMethodFilter,但是post请求还是会中文乱码,找了半天原因,后来发现,filter加载 ...
- MySQL-复制技术演进过程
复制技术的演进可以分为:基于数据安全的复制,基于效率的复制 基于数据安全的复制 异步复制 参考: https://baijiahao.baidu.com/s?id=163939455634386120 ...
- SAP_MM常用代码
1.采购申请创建/修改/查看:ME51N/ME52N/ME53N 2.采购申请审批:ME54N 3.采购订单创建/修改/查看:ME21N/ME22N/ME23N 4.单个采购订单审批:ME29N 5. ...
- POJ 2186:Popular Cows Tarjan模板题
Popular Cows Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 25945 Accepted: 10612 De ...