HDU-1391 Number Steps
http://acm.hdu.edu.cn/showproblem.php?pid=1391
Number Steps
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 3280 Accepted Submission(s): 2030
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.//看图找规律。x与y的关系。。。
#include<stdio.h>
int main()
{
int T,x,y;
scanf("%d",&T);
while(T--)
{
scanf("%d%d",&x,&y);
if(x!=y&&y+!=x)
{
printf("No Number\n");
}
else if(x==y)
{
if(x%==)
printf("%d\n",x+y);
else
printf("%d\n",x+y-);
}
else
{
if(x%==)
printf("%d\n",*x-);
else
printf("%d\n",*x-);
}
}
return ;
}
HDU-1391 Number Steps的更多相关文章
- HDU 1391 number steps(找规律,数学)
Starting from point (0,0) on a plane, we have written all non-negative integers 0, 1, 2,... as shown ...
- hdu 1391 Number Steps(规律)
题意:找规律 思路:找规律 #include<iostream> #include<stdio.h> using namespace std; int main(){ int ...
- HDOJ 1391 Number Steps(打表DP)
Problem Description Starting from point (0,0) on a plane, we have written all non-negative integers ...
- HDU 1711 Number Sequence(数列)
HDU 1711 Number Sequence(数列) Time Limit: 10000/5000 MS (Java/Others) Memory Limit: 32768/32768 K (Ja ...
- HDU 1005 Number Sequence(数列)
HDU 1005 Number Sequence(数列) Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Jav ...
- Number Steps
Number Steps Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Tota ...
- HDU 1005 Number Sequence(数论)
HDU 1005 Number Sequence(数论) Problem Description: A number sequence is defined as follows:f(1) = 1, ...
- HDU 4054 Number String
HDU 4054 Number String 思路: 状态:dp[i][j]表示以j结尾i的排列 状态转移: 如果s[i - 1]是' I ',那么dp[i][j] = dp[i-1][j-1] + ...
- HDU 1711 Number Sequence (字符串匹配,KMP算法)
HDU 1711 Number Sequence (字符串匹配,KMP算法) Description Given two sequences of numbers : a1, a2, ...... , ...
随机推荐
- JAVA中实现百分比
import java.text.NumberFormat; public class TeachYou { public static void main(String[] args) { //这里 ...
- java新手笔记21 接口
1.接口 package com.yfs.javase; public interface IDemo1 {//interface 接口 public /*abstract*/ void method ...
- java_UML:继承/泛化、实现、依赖、关联、聚合、组合的联系与区别 (2016-07-12)
分别介绍这几种关系: UML关系:继承(泛化).实现.依赖.关联.聚合.组合的联系与区别 一.表示符号上的区别 二.具体区别与联系 1. 继承/泛化(Generalization) [泛化关系]:是一 ...
- Activiti安装
1.Activiti下载与简介 1.1 简介 Activiti项目是一项新的基于Apache许可的开源BPM平台,从基础开始构建,旨在提供支持新的BPMN 2.0标准,包括支持对象管理组(OMG), ...
- 动态规划&矩阵连乘
动态规划&矩阵连乘 动态规划的概念 • 与分治方法类似 分-治-合 • 与分治方法不同 子问题之间并非相互独立 • 基本思想 用一个表记录 ...
- Codevs 1074 食物链 2001年NOI全国竞赛
1074 食物链 2001年NOI全国竞赛 时间限制: 3 s 空间限制: 64000 KB 题目等级 : 钻石 Diamond 传送门 题目描述 Description 动物王国中有三类动物 A,B ...
- Vivado Launching SDK "Importing Hardware Specification" error的解决方法
解决方法是通过参考http://forum.digilentinc.com/topic/611-vivado-launching-sdk-importing-hardware-specificatio ...
- ConcurrentHashMap中的2的n次方幂上舍入方法
最近看JDK中的concurrentHashMap类的源码,其中有那么一个函数: /** * Returns a power of two table size for the given desir ...
- android studio 自动序列化类插件
https://github.com/mcharmas/android-parcelable-intellij-plugin
- 学习JS
原型是Js中非常重要的概念,每个函数(在Js里面函数也是对象)都有一个叫prototype即原型)的属性,不过在一般情况下它的值都是null,但它他有一项非常重要的功能就是所以实例都会共享它里面的属性 ...