UVa 10176 - Ocean Deep ! - Make it shallow !!
题目大意:判断一个很大的二进制能否被131071整除。在二进制转十进制的过程中不断取模,最后判断结果是否是0就可以了。
#include <cstdio>
#include <cstring> int main()
{
#ifdef LOCAL
freopen("in", "r", stdin);
#endif
char str[];
while (gets(str))
{
int t = ;
bool stop = false;
do
{
int len = strlen(str);
for (int i = ; i < len; i++)
{
if (str[i] == '#')
{
stop = true;
break;
}
if (str[i] == '' || str[i] == '')
{
t = t * + str[i] - '';
if (t >= ) t %= ;
}
}
} while (!stop && gets(str));
if (t == ) printf("YES\n");
else printf("NO\n");
}
return ;
}
话说这个输入还是小小纠结了一下。
UVa 10176 - Ocean Deep ! - Make it shallow !!的更多相关文章
- Deep Learning and Shallow Learning
Deep Learning and Shallow Learning 由于 Deep Learning 现在如火如荼的势头,在各种领域逐渐占据 state-of-the-art 的地位,上个学期在一门 ...
- UVA 11573 - Ocean Currents(BFS+优先队列)
UVA 11573 - Ocean Currents 题目链接 题意:给定一个海面.数字分别代表海流方向,顺着海流不用费能量,逆海流要费1点能量,每次询问给一个起点一个终点,问起点到终点耗费的最小能量 ...
- python deep copy and shallow copy
Python中对于对象的赋值都是引用,而不是拷贝对象(Assignment statements in Python do not copy objects, they create bindings ...
- Summary: Deep Copy vs. Shallow Copy vs. Lazy Copy
Object copy An object copy is an action in computing where a data object has its attributes copied t ...
- UVA 11573 Ocean Currents --BFS+优先队列
采用优先队列做BFS搜索,d[][]数组记录当前点到源点的距离,每次出队时选此时eng最小的出队,能保证最先到达的是eng最小的.而且后来用普通队列试了一下,超时..所以,能用优先队列的,就要用优先队 ...
- deep copy and shallow copy
链接A:浅拷贝就是成员数据之间的一一赋值:把值赋给一一赋给要拷贝的值.但是可能会有这样的情况:对象还包含资源,这里的资源可以值堆资源,或者一个文件..当值拷贝的时候,两个对象就有用共同的资源,同时对资 ...
- 【深度学习Deep Learning】资料大全
最近在学深度学习相关的东西,在网上搜集到了一些不错的资料,现在汇总一下: Free Online Books by Yoshua Bengio, Ian Goodfellow and Aaron C ...
- 机器学习(Machine Learning)&深度学习(Deep Learning)资料
<Brief History of Machine Learning> 介绍:这是一篇介绍机器学习历史的文章,介绍很全面,从感知机.神经网络.决策树.SVM.Adaboost到随机森林.D ...
- [CareerCup] 13.4 Depp Copy and Shallow Copy 深拷贝和浅拷贝
13.4 What is the difference between deep copy and shallow copy? Explain how you would use each. 这道题问 ...
随机推荐
- L1,a private conversation
words enjoy喜欢,享受,欣赏 pay,支付,pay money for sth 报酬,I have not received my pay yet. bear,忍受,支撑,承担,负担 I c ...
- nginx 504 Gateway Time-out 解决办法
今天用PHP执行一个非常耗时的文件[ps:自己有用,大概3分钟] 但是执行到一分钟后显示 nginx 504 Gateway Time-out 于是修改php-ini.php中的max_executi ...
- cakephp , the subquery (2)
Cakephp 框架帮我们做了很多的工作,的确省了我们很多工作,提高了效率. 但是,碰到一些比较复杂的查询时,还是有些问题,官方的cookbook api 有说明一些详细的用法,但感觉还是不太够,有些 ...
- ASP.NET WebService
一.WebService:WebService是以独立于平台的方式,通过标准的Web协议,可以由程序访问的应用程序逻辑单元. (1)应用程序逻辑单元:web服务包括一些应用程序逻辑单元或者代码.这些代 ...
- android异步加载AsyncTask
http://blog.csdn.net/abc5382334/article/details/17097633 http://keeponmoving.iteye.com/blog/1515611 ...
- 基于Spring的异步系统实现方案
一般的实现方案 发送异步消息所使用的工具类: import java.util.Date; import javax.jms.Destination; import javax.jms.JMSExce ...
- 多文件上传插件Stream,是Uploadify的Flash版和Html5版的结合,带进度条,并支持html5断点续传(附件上传),拖拽等功能
是根据某网的文件上传插件加工而来,支持不同平台(Windows, Linux, Mac, Android, iOS)下,主流浏览器(IE7+, Chrome, Firefox, Safari, 其他) ...
- JavaScript运行原理解析
原文:1.http://blog.csdn.net/liaodehong/article/details/50488098 2.Stack的三种含义 (阮一峰) 3. http://lib.csdn. ...
- javascript 函数 add(1)(2)(3)(4)实现无限极累加 —— 一步一步原理解析
问题:我们有一个需求,用js 实现一个无限极累加的函数, 形如 add(1) //=> 1; add(1)(2) //=> 2; add(1)(2)(3) //=> 6; add ...
- Cow Hopscotch
Cow Hopscotch 题目描述 Just like humans enjoy playing the game of Hopscotch, Farmer John's cows have inv ...