POJ 1663:Number Steps】的更多相关文章

Number Steps Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 13758   Accepted: 7430 Description Starting from point (0,0) on a plane, we have written all non-negative integers 0,1,2, ... as shown in the figure. For example, 1, 2, and 3 h…
Number Steps Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 13664   Accepted: 7378 Description Starting from point (0,0) on a plane, we have written all non-negative integers 0,1,2, ... as shown in the figure. For example, 1, 2, and 3 h…
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 Problem Description Starting from point (0,0) on…
Number Steps Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 4482    Accepted Submission(s): 2732 Problem Description Starting from point (0,0) on a plane, we have written all non-negative integ…
一.题目大意 有这样一个序列包含S1,S2,S3...SK,每一个Si包括整数1到 i.求在这个序列中给定的整数n为下标的数. 例如,前80位为11212312341234512345612345671234567812345678912345678910123456789101112345678910,第8位为2. 二.题解 动手做这道题之前要了解所求的是第n位而不是某一个Si中的第几个数,一位数占一位,两位数占两位,三位占三位...由于每一组都比前一组多一个数,如果这个数是一位数,则该组数的…
Number Steps Time Limit: 2 Seconds      Memory Limit: 65536 KB Starting from point (0,0) on a plane, we have written all non-negative integers 0, 1, 2,... as shown in the figure. For example, 1, 2, and 3 has been written at points (1,1), (2,0), and (…
题目地址:http://poj.org/problem?id=1019 Number Sequence Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 35680   Accepted: 10287 Description A single positive integer i is given. Write a program to find the digit located in the position i in…
找规律,先找属于第几个循环,再找属于第几个数的第几位...... Number Sequence Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 31552 Accepted: 8963 Description A single positive integer i is given. Write a program to find the digit located in the position i in the sequ…
#include<iostream>//cheng da cai zi using namespace std; int main() { int time; cin>>time; while(time--){ int x; int y; int num; cin>>x; cin>>y; num=(x/)*+x; if(x==y) cout<<num<<endl; )) cout<<num-<<endl; el…
题目链接 题意 : 给你一个a进制的数串s,让你转化成b进制的输出. A = 10, B = 11, ..., Z = 35, a = 36, b = 37, ..., z = 61,0到9还是原来的含义. 思路 : 这个题因为牵扯了英文字母所以比较复杂一点,先将所有出现的英文字母转化成他们所代表的数,然后进行进制转换. //POJ 1220 #include <stdio.h> #include <string.h> #include <iostream> #incl…
Problem H Time Limit : 4000/2000ms (Java/Other)   Memory Limit : 65536/32768K (Java/Other) Total Submission(s) : 24   Accepted Submission(s) : 8 Problem Description A positive number y is called magic number if for every positive integer x it satisfi…
Problem Description Starting from point (0,0) on a plane, we have written all non-negative integers 0, 1, 2,- as shown in the figure. For example, 1, 2, and 3 has been written at points (1,1), (2,0), and (3, 1) respectively and this pattern has conti…
Problem Description Starting from point (0,0) on a plane, we have written all non-negative integers 0, 1, 2,... as shown in the figure. For example, 1, 2, and 3 has been written at points (1,1), (2,0), and (3, 1) respectively and this pattern has con…
题目连接:1220 NUMBER BASE CONVERSION 题目大意:给出两个进制oldBase 和newBase, 以及以oldBase进制存在的数.要求将这个oldBase进制的数转换成newBase进制的数. 解题思路:短除法,只不过时直接利用了高精度的除法运算, 并且将以前默认的*10换成的*oldBase. #include <stdio.h> #include <string.h> const int N = 1005; int newBase, oldBase,…
NUMBER BASE CONVERSION Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 5976   Accepted: 2738 Description Write a program to convert numbers in one base to numbers in a second base. There are 62 different digits: { 0-9,A-Z,a-z } HINT: If…
Starting from point (0,0) on a plane, we have written all non-negative integers 0, 1, 2,... as shown in the figure. For example, 1, 2, and 3 has been written at points (1,1), (2,0), and (3, 1) respectively and this pattern has continued. You are to w…
时间限制:1 秒 内存限制:32 兆 特殊判题:否 提交:691 解决:412 题目描述: Starting from point (0,0) on a plane, we have written all non-negative integers 0,1,2, ... as shown in the figure. For example, 1, 2, and 3 has been written at points (1,1), (2,0), and (3, 1) respectively…
题意:找规律 思路:找规律 #include<iostream> #include<stdio.h> using namespace std; int main(){ int n,x,y; scanf("%d",&n); while(n--){ scanf("%d%d",&x,&y); ?printf():printf("%d\n",x+x); )x&?printf():printf(&qu…
package com.njupt.acm; import java.math.BigInteger; import java.util.Scanner; public class POJ_1220_1 { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int t = scanner.nextInt(); while(t > 0){ BigInteger ba1 = scann…
这是一个看似简单,其实很难受. 本来我想发挥它的标题轨道基础.没想到反被消遣-_-|||. 看它在个人基础上,良好的数学就干脆点,但由于过于频繁,需求将被纳入全,因此,应该难度4星以上. 方法就是直接打表.然后直接模拟.利用打表去掉一大段数据,剩下数据量十分小了.故此能够直接模拟. 打表是为了计算前面的周期数,把周期数直接去掉. 主要难点是后面10位数以上的数有2位, 3位,4位等情况要考虑.- 以下使用getNewNums一个函数攻克了,想通了,就几行代码,还不用难理解的数学计算,呵呵. 然后…
https://vjudge.net/problem/POJ-1019 题意 给一串1 12 123 1234 12345 123456 1234567 12345678 123456789 12345678910 1234567891011这种形式的串,问这个串的第i个位置的数字是什么. 分析 这道题的重点在于到第k组时应该为几位数,即对于某个数x,它应该为几位数.答案是log10(x)+1.这样剩下的便是打表预处理了,找出每组的起始位置,再处理出一个最长的组. #include<iostre…
[题解] 数据结构采用线段树.通过将数组的每一段归并排序来建树.将数组排序来实现离散化. 时间复杂度分析:建树的过程就是归并排序,其时间复杂度为O(nlog(n)).查询时:二分查找第k小元素的复杂度为O(log(n)),访问一个节点的复杂度为O(log(n)).因此,查询一次的复杂度为O((logn)^3),总复杂度为O(m(logn)^3). 空间复杂度:O(n). [代码] #include <iostream> #include <cstdlib> #include <…
Log 2016-3-21 网上找的POJ分类,来源已经不清楚了.百度能百度到一大把.贴一份在博客上,鞭策自己刷题,不能偷懒!! 初期: 一.基本算法: (1)枚举. (poj1753,poj2965) (2)贪心(poj1328,poj2109,poj2586) (3)递归和分治法. (4)递推. (5)构造法.(poj3295) (6)模拟法.(poj1068,poj2632,poj1573,poj2993,poj2996) 二.图算法: (1)图的深度优先遍历和广度优先遍历. (2)最短路…
初期:一.基本算法:     (1)枚举. (poj1753,poj2965)     (2)贪心(poj1328,poj2109,poj2586)     (3)递归和分治法.     (4)递推.     (5)构造法.(poj3295)     (6)模拟法.(poj1068,poj2632,poj1573,poj2993,poj2996)二.图算法:     (1)图的深度优先遍历和广度优先遍历.     (2)最短路径算法(dijkstra,bellman-ford,floyd,hea…
初期: 一.基本算法:      (1)枚举. (poj1753,poj2965)      (2)贪心(poj1328,poj2109,poj2586)      (3)递归和分治法.      (4)递推.      (5)构造法.(poj3295)      (6)模拟法.(poj1068,poj2632,poj1573,poj2993,poj2996) 二.图算法:      (1)图的深度优先遍历和广度优先遍历.      (2)最短路径算法(dijkstra,bellman-ford…
poj 题目分类 按照ac的代码长度分类(主要参考最短代码和自己写的代码) 短代码:0.01K--0.50K:中短代码:0.51K--1.00K:中等代码量:1.01K--2.00K:长代码:2.01K以上. 短:1147.1163.1922.2211.2215.2229.2232.2234.2242.2245.2262.2301.2309.2313.2334.2346.2348.2350.2352.2381.2405.2406: 中短:1014.1281.1618.1928.1961.2054…
本文来自:http://www.cppblog.com/snowshine09/archive/2011/08/02/152272.spx 多版本的POJ分类 流传最广的一种分类: 初期: 一.基本算法: (1)枚举. (poj1753,poj2965) (2)贪心(poj1328,poj2109,poj2586) (3)递归和分治法. (4)递推. (5)构造法.(poj3295) (6)模拟法.(poj1068,poj2632,poj1573,poj2993,poj2996) 二.图算法:…
初期:一.基本算法:     (1)枚举. (poj1753,poj2965)     (2)贪心(poj1328,poj2109,poj2586)     (3)递归和分治法.     (4)递推.     (5)构造法.(poj3295)     (6)模拟法.(poj1068,poj2632,poj1573,poj2993,poj2996)二.图算法:     (1)图的深度优先遍历和广度优先遍历.     (2)最短路径算法(dijkstra,bellman-ford,floyd,hea…
acm之pku题目分类 对ACM有兴趣的同学们可以看看 DP:  1011   NTA                 简单题  1013   Great Equipment     简单题  1024   Calendar Game       简单题  1027   Human Gene Functions   简单题  1037   Gridland            简单题  1052   Algernon s Noxious Emissions 简单题  1409   Commun…
http://www.cnblogs.com/kuangbin/archive/2011/07/29/2120667.html 初期:一.基本算法:     (1)枚举. (poj1753,poj2965)     (2)贪心(poj1328,poj2109,poj2586)     (3)递归和分治法.     (4)递推.     (5)构造法.(poj3295)     (6)模拟法.(poj1068,poj2632,poj1573,poj2993,poj2996)二.图算法:     (…