POJ 1663:Number Steps
| Time Limit: 1000MS | Memory Limit: 10000K | |
| Total Submissions: 13758 | Accepted: 7430 |
Description

You are to write a program that reads the coordinates of a point (x, y), and writes the number (if any) that has been written at that point. (x, y) coordinates in the input are in the range 0...5000.
Input
Output
Sample Input
3
4 2
6 6
3 4
Sample Output
6
12
No Number
Source
你 离 开 了 , 我 的 世 界 里 只 剩 下 雨 。 。 。
#include<iostream>
using namespace std;
int main()
{
int n;
cin>>n;
while(n--)
{
int a,b;
cin>>a>>b;
if(a==b||a-b==2)
{
if(a==b)
{
if(a&1)cout<<2*a-1<<endl;
else cout<<2*a<<endl;
}
else
{
if(b&1)cout<<2*a-3<<endl;
else cout<<2*a-2<<endl;
}
}
else cout<<"No Number"<<endl;
}
return 0;
}
POJ 1663:Number Steps的更多相关文章
- POJ 1663:Number Steps
Number Steps Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 13664 Accepted: 7378 Des ...
- HDU-1391 Number Steps
http://acm.hdu.edu.cn/showproblem.php?pid=1391 Number Steps Time Limit: 2000/1000 MS (Java/Others) ...
- Number Steps
Number Steps Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Tota ...
- Poj 1019 Number Sequence( 数据分析和操作)
一.题目大意 有这样一个序列包含S1,S2,S3...SK,每一个Si包括整数1到 i.求在这个序列中给定的整数n为下标的数. 例如,前80位为1121231234123451234561234567 ...
- ZOJ 1414:Number Steps
Number Steps Time Limit: 2 Seconds Memory Limit: 65536 KB Starting from point (0,0) on a plane, ...
- poj 1019 Number Sequence 【组合数学+数字x的位宽函数】
题目地址:http://poj.org/problem?id=1019 Number Sequence Time Limit: 1000MS Memory Limit: 10000K Total ...
- POJ 1019 Number Sequence
找规律,先找属于第几个循环,再找属于第几个数的第几位...... Number Sequence Time Limit: 1000MS Memory Limit: 10000K Total Submi ...
- POJ 1663
#include<iostream>//cheng da cai zi using namespace std; int main() { int time; cin>>tim ...
- POJ 1220 NUMBER BASE CONVERSION(较复杂的进制转换)
题目链接 题意 : 给你一个a进制的数串s,让你转化成b进制的输出. A = 10, B = 11, ..., Z = 35, a = 36, b = 37, ..., z = 61,0到9还是原来的 ...
随机推荐
- Analysis of container and Injection in Java, their history and future.
Container: 发展历程: 2000 年的时候 FreeBSD 开发了一个类似于 chroot 的容器技术 Jails,这是最早期,也是功能最多的容器技术.Jails 英译过来是监狱的意思,这个 ...
- Spring Boot 2.0的属性绑定
Spring Boot2.0的属性绑定 原文从Spring boot第一个版本以来,我们可以使用@ConfigurationProperties注解将属性绑定到对象.也可以指定属性的各种不同格式.比如 ...
- Rest 参数(...)
javascript 之Rest 参数(...) ES6 Rest参数 Rest就是为解决传入的参数数量不一定, rest parameter(Rest 参数) 本身就是数组,数组的相关的方法都可以用 ...
- C++ Primer(第4版)-学习笔记-第4部分:面向对象编程与泛型编程
第15章 面向对象编程OOP(Object-oriented programming) 面向对象编程基于三个基本概念:数据抽象.继承和动态绑定. 在 C++ 中,用类进行 ...
- [LNOI2014]LCA(树链剖分)
BZOJ传送门 Luogu传送门 题目:给你一棵树,给你n个询问,每个询问要求输出$\sum_{i=l}^{r}depth(LCA(i,z))$ 细看看其实没有想象的那么难 大体思路: 1.对于每个询 ...
- Python学习第二阶段Day2,模块time/datetime、random、os、sys、shutil
1.Time. Datetime(常用) UTC时间:为世界标准时间,时区为0的时间 北京时间,UTC+8东八区 import time print(time.time()) # timestamp ...
- python实现定时发送qq消息
因为生活中老是忘记各种事情,刚好又在学python,便突发奇想通过python实现提醒任务的功能(尽管TIM有定时功能),也可定时给好友.群.讨论组发送qq消息.其工作流程是:访问数据库提取最近计划— ...
- PyQt5Icon图标(Icon)无法显示问题
PyQt5中设置图标无法显示 以下源码来源PyQt5教程http://zetcode.com/gui/pyqt5/firstprograms/ import sys from PyQt5.QtWidg ...
- Uva 10730 Antiarithmetic?
uva 10730 题意:给出一列数字,如果其中存在长度大于等于3的等差数列,输出no,不存在就输出yes 这道题标定了数列长度n,而且这n个数数据范围是从0到n-1,没有相同的数,这就给我们枚举提供 ...
- 在 Oculus和 Gear VR上开发跨平台的 VR应用
本文章由cartzhang编写,转载请注明出处. 所有权利保留. 文章链接:http://blog.csdn.net/cartzhang/article/details/51433994 作者:car ...