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的更多相关文章

  1. URAL 1180. Stone Game (博弈 + 规律)

    1180. Stone Game Time limit: 1.0 second Memory limit: 64 MB Two Nikifors play a funny game. There is ...

  2. timus 1180. Stone Game 解题报告

    1.题目: 1180. Stone Game Time limit: 1.0 secondMemory limit: 64 MB Two Nikifors play a funny game. The ...

  3. 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 ...

  4. ural 1005 Stone Pile

    这是道01背包题   ,尽管背包不会  ,可是还是看出来了,递推公式写啊写没写出来,后来一同学说是dfs.这我就開始了A了, 题意是给你n个重量是Wn的石头  让你放到两个包里面.看他们两个差值最小, ...

  5. 1068 Bash游戏 V3

    1068 Bash游戏 V3 题目来源: Ural 1180 基准时间限制:1 秒 空间限制:131072 KB 分值: 20 难度:3级算法题  收藏  关注 有一堆石子共有N个.A B两个人轮流拿 ...

  6. 51 Nod 1068 Bash游戏v3

    1068 Bash游戏 V3  题目来源: Ural 1180 基准时间限制:1 秒 空间限制:131072 KB 分值: 20 难度:3级算法题  收藏  关注 有一堆石子共有N个.A B两个人轮流 ...

  7. 博弈论 x

    ——关于博弈论 四道例题带你走进博弈论~ (考虑必败态,必胜态) Ps:要理解这种思想,首先要明白什么叫必败态.说简单点,必败态就是“在对方使用最优策略时,无论做出什么决策都会导致失败的局面”.其他的 ...

  8. ural 1252. Sorting the Tombstones

    1252. Sorting the Tombstones Time limit: 1.0 secondMemory limit: 64 MB There is time to throw stones ...

  9. Ural 1018 (树形DP+背包+优化)

    题目链接: http://acm.hust.edu.cn/vjudge/problem/viewProblem.action?id=17662 题目大意:树枝上间连接着一坨坨苹果(不要在意'坨'),给 ...

随机推荐

  1. libvirt API管理hypervisors

    发布一段C代码,用于连接指定的KVM宿主机器,获得该宿主机器的配置信息,以及该主机上所有的虚拟主机列表.状态及配置信息: #include <stdio.h>#include <st ...

  2. K - The Unique MST - poj 1679

    题目的意思已经说明了一切,次小生成树... ****************************************************************************** ...

  3. C# 关键字--using

    using 关键字有两个主要用途:  (一).作为指令,用于为命名空间创建别名或导入其他命名空间中定义的类型.  (二).作为语句,用于定义一个范围,在此范围的末尾将释放对象. using指令    ...

  4. 防止程序启动两次的方法CreateMutex()

    在工程文件中, WinMain函数里加上以下代码 HANDLE hMutex = CreateMutex(NULL, false, "Process"); if (GetLastE ...

  5. SQLite3基本使用从shell到python

    SQLite是一个轻量级的关系型数据库,在訪问量不超过10万PV的中小站点中使用绰绰有余. 并且使用方便,接口简单,以下从命令行和python接口双方面介绍SQLite3的基本操作. 在linux终端 ...

  6. Xamarin改写安卓Residemenu控件

    1.下载最新的Residemenu安卓代码.用intellig打开,重新编译一下. 2.需要将其中的Residemenu,用gradle编译生成*.aar文件格式. 2.1 下载gradle,配置环境 ...

  7. [AngularJS] Using $parse Service

    $parse is useful when you want to parse an expression and the context is not defined yet. For exampl ...

  8. linux 启动network后报错:device eth0 does not seem to be present, delaying initialization

    问题背景: 在vsphere client中部署ovf模板后启动linux 的network后提示:device eth0 does not seem to be present, delaying ...

  9. 配置Windows下编译运行C/C++过程

    1.首先确定电脑安装了VS或者VC++的IDE: 2.修改环境变量 在系统属性-高级-环境变量-用户变量中: 编辑PATH增加cl编译器的路径D:\Program Files\Microsoft Vi ...

  10. bootstrap初探2

    控制是否显示:visible-(lg | md | sm |sx)-(block | inline | inline-block), hidden-(lg | md | sm |sx) <!DO ...