ZSTU4269 买iphone 2017-03-22 14:31 73人阅读 评论(0) 收藏
4269: 买iphone
Time Limit: 3 Sec Memory Limit: 128 MB
Submit: 1710 Solved: 316
Description
Input
Output
Sample Input
10 3 3 3 4
20 7 1 1 1
80 3 100 3 3
15 4 3 5 6
Sample Output
Yes
No
No
Yes
HINT
————————————————————————————
#include<map>
#include<set>
#include<ctime>
#include<cmath>
#include<queue>
#include<bitset>
#include<string>
#include<vector>
#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
#include<functional>
using namespace std;
#define inf 0x3f3f3f3f int main()
{
int a[3],n,k;
while(~scanf("%d%d%d%d%d",&n,&k,&a[0],&a[1],&a[2]))
{
sort(a,a+3);
int flag=0;
for(int i=0; i<=k&&i*a[2]<=n; i++)
{
int m=n-a[2]*i;
int t=k-i;
if(t*a[0]>m||t*a[1]<m)
continue;
if(a[1]==a[0])
{
if(t*a[0]==m)
{
flag=1;
break;
}
else
continue; }
if((m-t*a[0])%(a[1]-a[0])==0)
{
flag=1;
break;
} }
if(flag==0)
printf("No\n");
else
printf("Yes\n"); } return 0;
}
ZSTU4269 买iphone 2017-03-22 14:31 73人阅读 评论(0) 收藏的更多相关文章
- mysql快速入门 分类: B6_MYSQL 2015-04-28 14:31 284人阅读 评论(0) 收藏
debian方式: apt-get install mysql-server-5.5 mysql -u root -p redhat安装方式 一.下载并解压 $ wget http://cdn ...
- 【Solr专题之九】SolrJ教程 分类: H4_SOLR/LUCENCE 2014-07-28 14:31 2351人阅读 评论(0) 收藏
一.SolrJ基础 1.相关资料 API:http://lucene.apache.org/solr/4_9_0/solr-solrj/ apache_solr_ref_guide_4.9.pdf:C ...
- HDU1181 变形课(DFS) 2016-07-24 13:31 73人阅读 评论(0) 收藏
变形课 Problem Description 呃......变形课上Harry碰到了一点小麻烦,因为他并不像Hermione那样能够记住所有的咒语而随意的将一个棒球变成刺猬什么的,但是他发现了变形咒 ...
- iOS正则表达式 分类: ios技术 2015-07-14 14:00 35人阅读 评论(0) 收藏
一.什么是正则表达式 正则表达式,又称正规表示法,是对字符串操作的一种逻辑公式.正则表达式可以检测给定的字符串是否符合我们定义的逻辑,也可以从字符串中获取我们想要的特定部分.它可以迅速地用极简单的方式 ...
- Hdu2181 哈密顿绕行世界问题 2017-01-18 14:46 45人阅读 评论(0) 收藏
哈密顿绕行世界问题 Time Limit : 3000/1000ms (Java/Other) Memory Limit : 32768/32768K (Java/Other) Total Sub ...
- Hadoop入门经典:WordCount 分类: A1_HADOOP 2014-08-20 14:43 2514人阅读 评论(0) 收藏
以下程序在hadoop1.2.1上测试成功. 本例先将源代码呈现,然后详细说明执行步骤,最后对源代码及执行过程进行分析. 一.源代码 package org.jediael.hadoopdemo.wo ...
- Lucene学习总结之四:Lucene索引过程分析 2014-06-25 14:18 884人阅读 评论(0) 收藏
对于Lucene的索引过程,除了将词(Term)写入倒排表并最终写入Lucene的索引文件外,还包括分词(Analyzer)和合并段(merge segments)的过程,本次不包括这两部分,将在以后 ...
- cubieboard变身AP 分类: ubuntu cubieboard 2014-11-25 14:04 277人阅读 评论(0) 收藏
加载bcmdhd模块:# modprobe bcmdhd 如果你希望开启 AP 模式,那么:# modprobe bcmdhd op_mode=2 在/etc/modules文件内添加bcmdhd o ...
- zstu4273 玩具 2017-03-22 14:18 49人阅读 评论(0) 收藏
4273: 玩具 Time Limit: 1 Sec Memory Limit: 128 MB Submit: 700 Solved: 129 Description 商店有n个玩具,第i个玩具有 ...
随机推荐
- 转- 集群NAS技术架构
集群NAS技术架构 标签: 集群存储负载均衡扩展服务器网络 原贴:http://blog.csdn.net/liuaigui/article/details/6422700 作者刘爱贵 1 什么是集群 ...
- Windows应用程序的VC链接器设置
Windows应用程序的VC链接器设置 /*转载请注明出自 听风独奏 www.GbcDbj.com */ Windows应用程序分为GUI(Graphical User Interface)和CUI( ...
- wchar_t char string wstring 之间的转换
wchar_t char string wstring 之间的转换 转:http://blog.csdn.net/lbd2008/article/details/8333583 在处理中文时有时需要进 ...
- Azkaban任务流编写
在Azkaban中,一个project包含一个或多个flows,一个flow包含多个job.job是你想在azkaban中运行的一个进程,可以是Command,也可以是一个Hadoop任务.当然,如果 ...
- PDF预览之PDFObject.js总结
get from:PDF预览之PDFObject.js总结 PDFObject.js - 将PDF嵌入到一个div内,而不是占据整个页面(要求浏览器支持显示PDF,不支持,可配置PDF.js来实现 ...
- c#,条码
static void Generate2(string text){ BarcodeWriter writer = new BarcodeWriter(); //使用ITF 格式,不能被现在常用的支 ...
- np的归纳总结
1. np.sqrt(input) # 求数的开方 import numpy as np print(np.sqrt(2)) 2. np.square(3) # 求数的平方 import n ...
- mpg123解码相关
int attribute_align_arg mpg123_decode(mpg123_handle *mh, const unsigned char *inmemory, size_t inmem ...
- IE浏览器中不支持cookie问题
/** * Cookie plugin * * Copyright (c) 2006 Klaus Hartl (stilbuero.de) * Dual licensed under the MIT ...
- JAXB--@XmlElementWrapper注解(二)
在JAXB标准中,@XmlElementWrapper注解表示生成一个包装 XML 表示形式的包装器元素. 此元素主要用于生成一个包装集合的包装器 XML 元素.因此,该注释支持以下两种形式的序列化. ...