ural 1180 Stone Game
http://acm.timus.ru/problem.aspx?space=1&num=1180
#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std; int main()
{
char s1[];
scanf("%s",s1);
int k=strlen(s1);
int sum=;
for(int i=; i<k; i++)
{
sum+=(s1[i]-'');
}
if(sum%==)
printf("2\n");
else
printf("1\n%d\n",sum%);
return ;
}
ural 1180 Stone Game的更多相关文章
- URAL 1180. Stone Game (博弈 + 规律)
1180. Stone Game Time limit: 1.0 second Memory limit: 64 MB Two Nikifors play a funny game. There is ...
- timus 1180. Stone Game 解题报告
1.题目: 1180. Stone Game Time limit: 1.0 secondMemory limit: 64 MB Two Nikifors play a funny game. The ...
- Timus 1180. Stone Game 游戏题目
Two Nikifors play a funny game. There is a heap of N stones in front of them. Both Nikifors in turns ...
- ural 1005 Stone Pile
这是道01背包题 ,尽管背包不会 ,可是还是看出来了,递推公式写啊写没写出来,后来一同学说是dfs.这我就開始了A了, 题意是给你n个重量是Wn的石头 让你放到两个包里面.看他们两个差值最小, ...
- 1068 Bash游戏 V3
1068 Bash游戏 V3 题目来源: Ural 1180 基准时间限制:1 秒 空间限制:131072 KB 分值: 20 难度:3级算法题 收藏 关注 有一堆石子共有N个.A B两个人轮流拿 ...
- 51 Nod 1068 Bash游戏v3
1068 Bash游戏 V3 题目来源: Ural 1180 基准时间限制:1 秒 空间限制:131072 KB 分值: 20 难度:3级算法题 收藏 关注 有一堆石子共有N个.A B两个人轮流 ...
- 博弈论 x
——关于博弈论 四道例题带你走进博弈论~ (考虑必败态,必胜态) Ps:要理解这种思想,首先要明白什么叫必败态.说简单点,必败态就是“在对方使用最优策略时,无论做出什么决策都会导致失败的局面”.其他的 ...
- ural 1252. Sorting the Tombstones
1252. Sorting the Tombstones Time limit: 1.0 secondMemory limit: 64 MB There is time to throw stones ...
- Ural 1018 (树形DP+背包+优化)
题目链接: http://acm.hust.edu.cn/vjudge/problem/viewProblem.action?id=17662 题目大意:树枝上间连接着一坨坨苹果(不要在意'坨'),给 ...
随机推荐
- Jenkins的错误“error fetching remote repo origin”的问题解决
错误如上,解决方法收集,可以尝试以下方法: http://stackoverflow.com/questions/38391601/jenkins-error-error-fetching-remot ...
- java cmd常用命令
熟悉Java的常用命令 面试例题11:使用jar命令. 请使用jar命令,将test文件夹压缩成.jar文件,并简述其压缩包的结构. 考点:对于Java程序员来说,更多情况下是使用集成Java开发工具 ...
- SKPhysicsJointLimit类
继承自 NSObject 符合 NSCoding(SKPhysicsJoint)NSObject(NSObject) 框架 /System/Library/Frameworks/SpriteKit. ...
- Oracle's Business Intelligence Applications Configuration Manager 基本概念
Oracle's Business Intelligence Applications Configuration Manager :BIACM Once the BIAPPS installatio ...
- Android - Ashmem驱动
以下资料摘录整理自老罗的Android之旅博客,是对老罗的博客关于Android底层原理的一个抽象的知识概括总结(如有错误欢迎指出)(侵删):http://blog.csdn.net/luosheng ...
- ado.net(1)
connection对象处于最顶层,是所有数据请求的关口 数据库连接过程 SqlConnection theConnection = new SqlConnection(); //创建一个connec ...
- There is already an open DataReader associated with this Connection which must be closed first
使用MVC4 EF Linq获取foreach列表循环的时候遇到了如下的问题:报错提示 There is already an open DataReader associated with this ...
- Eclipse利用代理快速安装插件
在eclipse启动时增加以下参数: eclipse.exe -vmargs -DproxySet=true -DproxyHost=aProxyAddress -DproxyPort=aProxyP ...
- AndroidSdk下载地址和环境变量配置
一.Android Studio 下的AndroidSdk下载地址 http://tools.android-studio.org/index.php/sdk 二.Android Sdk环境变量设置 ...
- grep,awk和sed
commons: all of them could use regular-expression to match the result. differences: 1)grep: search f ...