HDU 5523 Game
坑题
#include<cstdio>
#include<cstring>
#include<cmath>
#include<algorithm>
using namespace std; int main()
{
int N,S,T;
while(~scanf("%d%d%d",&N,&S,&T))
{
if((S==&&T==N)||(S==N&&T==))
{
printf("0\n");
continue;
} if(S==T)
{
printf("-1\n");
continue;
} if((<S&&S<T&&T<N)||(<T&&T<S&&S<N))
{ if(abs(S-T)==)
{
printf("1\n");
continue;
}
else if(abs(S-T)!=)
{
printf("2\n");
continue;
}
} if(S==||S==N)
{
printf("1\n");
continue;
} if(T==||T==N)
{
if(abs(T-S)==) printf("1\n");
else printf("2\n");
continue;
}
}
return ;
}
HDU 5523 Game的更多相关文章
- HDU 5523:Game
Game Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others) 问题描述 XY在玩一 ...
- HDOJ 2111. Saving HDU 贪心 结构体排序
Saving HDU Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total ...
- 【HDU 3037】Saving Beans Lucas定理模板
http://acm.hdu.edu.cn/showproblem.php?pid=3037 Lucas定理模板. 现在才写,noip滚粗前兆QAQ #include<cstdio> #i ...
- hdu 4859 海岸线 Bestcoder Round 1
http://acm.hdu.edu.cn/showproblem.php?pid=4859 题目大意: 在一个矩形周围都是海,这个矩形中有陆地,深海和浅海.浅海是可以填成陆地的. 求最多有多少条方格 ...
- HDU 4569 Special equations(取模)
Special equations Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u S ...
- HDU 4006The kth great number(K大数 +小顶堆)
The kth great number Time Limit:1000MS Memory Limit:65768KB 64bit IO Format:%I64d & %I64 ...
- HDU 1796How many integers can you find(容斥原理)
How many integers can you find Time Limit:5000MS Memory Limit:32768KB 64bit IO Format:%I64d ...
- hdu 4481 Time travel(高斯求期望)(转)
(转)http://blog.csdn.net/u013081425/article/details/39240021 http://acm.hdu.edu.cn/showproblem.php?pi ...
- HDU 3791二叉搜索树解题(解题报告)
1.题目地址: http://acm.hdu.edu.cn/showproblem.php?pid=3791 2.参考解题 http://blog.csdn.net/u013447865/articl ...
随机推荐
- Codeforces Round #364 (Div. 2) E. Connecting Universities
E. Connecting Universities time limit per test 3 seconds memory limit per test 256 megabytes input s ...
- Encoding filter 编码过滤器
1.首先编写过滤器,实际上就是继承了filter接口的一个类,实现其中的init doChain 和destroy方法 package com.util; import java.io.IOExc ...
- ASP.NET中使用Server.Transfer()方法在页间传值 实例
以下代码在VS2008中测试通过 <%@ Page Language="C#" AutoEventWireup="true" CodeFile=" ...
- wpf CollectionViewSource的运用
实体类: 员工类: public class Department : ObservableCollection<Employee> { public string DepName { g ...
- ant 配置expdp and impap
+ 执行步骤: ant -f 1_exp_prod.xml copy file from prod to uat (maunule) ant -f 3_imp_uat.xml 附件: 1.1_exp ...
- 【同一直线最多点】 poj 1118+2606+2780
poj 1118 #include<iostream> using namespace std; #define N 700 struct point {int x,y;} pnt[N]; ...
- 过滤器HttpModule
1.建一个类库文件 FirsModule,实现IHttpModule接口,实现其中的两个方法,写一函数实现自己的代码逻辑,在Init方法中调用即可. // <summary> /// 第 ...
- curl file_get_contents fsockopen
三种处理的方式: curl file_get_contents fsockopen fsockopen 是比较底层的调用,属于网络系统的socket调用,而curl经过的包装支 ...
- Android之SurfaceView学习(一)转转
Android之SurfaceView学习(一) 首先我们先来看下官方API对SurfaceView的介绍 SurfaceView的API介绍 Provides a dedicated drawing ...
- python 对比图片相似度
最近appium的使用越来越广泛了,对于测试本身而言,断言同样是很重要的,没有准确的断言那么就根本就不能称之为完整的测试了.那么目前先从最简单的截图对比来看.我这里分享下python的图片相似度的代码 ...