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 ...
随机推荐
- Python MySQL Delete
章节 Python MySQL 入门 Python MySQL 创建数据库 Python MySQL 创建表 Python MySQL 插入表 Python MySQL Select Python M ...
- python_@classmethod
class A(object): bar = 1 def func1(self): print ('foo') @classmethod def func2(cls): print ('func2') ...
- UVA - 11491 Erasing and Winning(奖品的价值)(贪心)
题意:有一个n位整数(不以0开头),要求删除其中的d个数字,使结果尽量大.(1<=d<n<=10^5) 分析: 1.从头扫一遍,如果当前填的数字小于n-d,则将当前数字填上. 2.如 ...
- 51nod 1429:巧克力
1429 巧克力 题目来源: CodeForces 基准时间限制:1 秒 空间限制:131072 KB 分值: 80 难度:5级算法题 收藏 关注 现在有两个块巧克力一块大小是 的,另外一块大 ...
- maven工程运行演示
通过maven提供的命令来运行maven工程,体会maven构建工程的优点. (1)运行web工程 进入maven工程目录(当前目录有pom.xml),运行tomcat:run命令 可能出现的问 ...
- JS照片轮换
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- javascript实现抽奖程序
昨天开年会的时候看到一个段子说唯品会年会抽奖,结果大奖都被写抽奖程序的部门得了,CTO现场review代码. 简单想了一下抽奖程序的实现,花了十几分钟写了一下,主要用到的知识有数组添加删除,以及ES5 ...
- 装WIN7的一点心得
一.为什么要装WIN7 长久以来个人的习惯,WIN10用不来,总体安装思路是:下官方版,找方法激活 二.安装镜像的来源 这个网上版本五花八门,各种系统网站,但都会有软件捆绑等行为,还有浏览器中强制捆了 ...
- 51Nod1049 最大子段和
我们来先看题: N个整数组成的序列a1,a2,a3,-,an,求该序列如ai+ai+1+-+aj的连续子段和的最大值.当所给的整数均为负数时和为0. 例如:-2,11,-4,13,-5,-2,和最大的 ...
- mysql初始化出现:FATAL ERROR: Neither host 'DB01' nor 'localhost' could be looked up with
初始化时: FATAL ERROR: Neither host 'DB01' nor 'localhost' could be looked up with /application/mysql/bi ...