hdu 1597 find the nth digit (数学)】的更多相关文章

find the nth digit Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 7403    Accepted Submission(s): 2120 Problem Description 假设:S1 = 1S2 = 12S3 = 123S4 = 1234.........S9 = 123456789S10 = 12345678…
find the nth digit Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 9836    Accepted Submission(s): 2881 Problem Description 假设:S1 = 1S2 = 12S3 = 123S4 = 1234.........S9 = 123456789S10 = 12345678…
二分. #include <stdio.h> #include <math.h> int main() { int case_n; double n, tmp, l, r; int m; scanf("%d", &case_n); while (case_n--) { scanf("%lf", &n); tmp = sqrt(n+n); tmp = ceil(tmp); l = (tmp*tmp-tmp)/; r = (tmp…
题目连接:http://acm.hdu.edu.cn/showproblem.php?pid=1597 find the nth digit Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 9517    Accepted Submission(s): 2757 Problem Description 假设:S1 = 1S2 = 12S3…
find the nth digit Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 14416    Accepted Submission(s): 4444 Problem Description 假设: S1 = 1 S2 = 12 S3 = 123 S4 = 1234 ......... S9 = 123456789 S10 =…
Find the nth digit of the infinite integer sequence 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, ... Note: n is positive and will fit within the range of a 32-bit signed integer (n < 231). Example 1: Input: 3 Output: 3 Example 2: Input: 11 Output: 0 Explanatio…
Find the nth digit of the infinite integer sequence 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, ... Note: n is positive and will fit within the range of a 32-bit signed integer (n < 231). Example 1: Input: 3 Output: 3 Example 2: Input: 11 Output: 0 Explanatio…
Find the nth digit of the infinite integer sequence 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, ... Note: n is positive and will fit within the range of a 32-bit signed integer (n < 231). Example 1: Input: 3 Output: 3 Example 2: Input: 11 Output: 0 Explanatio…
Find the nth digit of the infinite integer sequence 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, ... Note:n is positive and will fit within the range of a 32-bit signed integer (n < 231). Example 1: Input: 3 Output: 3 Example 2: Input: 11 Output: 0 Explanation…
leetcode 400. Nth Digit 在线提交网址: https://leetcode.com/problems/nth-digit/ Total Accepted: 4356 Total Submissions: 14245 Difficulty: Easy Find the nth digit of the infinite integer sequence 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, - Note: n is positive and w…
Question Find the nth digit of the infinite integer sequence 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, ... Note: n is positive and will fit within the range of a 32-bit signed integer (n < 231). Example 1: Input: 3 Output: 3 Example 2: Input: 11 Output: 0 E…
Find the nth digit of the infinite integer sequence 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, ... Note:n is positive and will fit within the range of a 32-bit signed integer (n < 231). Example 1: Input: 3 Output: 3 Example 2: Input: 11 Output: 0 Explanation…
find the nth digit                                                                    Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)                                                                                …
Martyr2项目实现--Number部分的问题求解 (1) Find Pi to Nth Digit Find Pi to Nth Digit 问题描述: Find PI to the Nth Digit – Enter a number and have the program generate PI up to that many decimal places. Keep a limit to how far the program will go. 翻译: 给定一个整数N,让程序生成精确…
作者: 负雪明烛 id: fuxuemingzhu 个人博客: http://fuxuemingzhu.cn/ 目录 题目描述 题目大意 解题方法 日期 题目地址:https://leetcode.com/problems/reach-a-number/description/ 题目描述 Find the nth digit of the infinite integer sequence 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, - Note: n is posit…
1060 - Leftmost Digit 1601 - Rightmost Digit 1060题意很简单,求n的n次方的值的最高位数,我们首先设一个数为a,则可以建立一个等式为n^n = a * 10^x;其中x也是未知的: 两边取log10有:lg(n^n) = lg(a * 10^x); 即:n * lg(n)  - x = lg(a); 现在就剩x一个变量了,我们知道x是值n^n的位数-1,a向下取整就是我们要求的数: 所以 按着上面的推导式翻译成代码就可以了(注意:数值的范围和之间的…
History repeat itself Time Limit: 1000ms Memory Limit: 32768KB This problem will be judged on HDU. Original ID: 434264-bit integer IO format: %I64d      Java class name: Main Prev Submit Status Statistics Discuss Next Type: None   None Graph Theory 2…
2019 杭电多校 8 1003 题目链接:HDU 6659 比赛链接:2019 Multi-University Training Contest 8 Problem Description Acesrc is a famous mathematician at Nanjing University second to none. Playing with interesting numbers is his favorite. Today, he finds a manuscript whe…
题目链接: POJ:id=3100" style="font-size:18px">http://poj.org/problem? id=3100 ZOJ:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=1818 HDU:pid=2740">http://acm.hdu.edu.cn/showproblem.php?pid=2740 Description Given positive…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5019 Problem Description In mathematics, the greatest common divisor (gcd), also known as the greatest common factor (gcf), highest common factor (hcf), or greatest common measure (gcm), of two or more i…
Explore Track of Point Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://acm.hdu.edu.cn/showproblem.php?pid=5476 Description In Geometry, the problem of track is very interesting. Because in some cases, the track of point may be beautiful curve. For…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4091 /** 这题的一种思路就是枚举了: 基于这样一个事实:求出lcm = lcm(s1,s2), num1 = lcm/s1, num2 = lcm/s2; 则价值与体积比小的那个宝藏个数一定大于lcm/size;这个用反证法就可证明. 然后就是只需要枚举N%lcm + lcm这个体积的最有分配. */ #include<cstdio> #include<cstring> #incl…
这个EASY难度的题怎么感觉比H的还难,昨天没做出来,今天才做出来.. 呃啊..我生 气 啦.. 直接看的答案,耻辱. 1 digit: 1~9 总共1×9个 2 digits: 10~99 总共2×90个 3 digits: 100~999 总共3×900个 .. ..... 所以就是先定位大区间,再从区间开始找确切位置.. public class Solution { public int findNthDigit(int n) { int digits = 1; long count =…
传送门:http://acm.hdu.edu.cn/showproblem.php?pid=4099 这个题目就是一个坑或. 题意:给你不超过40的一串数字,问你这串数字是Fibonacci多少的开头几位数字,如果不存在则输出-1. 题解:明明说好的不超过40,但是在建字典数的时候不加i<41就超内存了,杭电你是想咋地,害的我比较好多人的代码,一点一点试出来的. AC代码: #include <iostream> #include <cstdio> #include <…
Problem Description   You live in a village but work in another village. You decided to follow the straight path between your house (A) and the working place (B), but there are several rivers you need to cross. Assume B is to the right of A, and all…
Clarke and math 题目连接: http://acm.hdu.edu.cn/showproblem.php?pid=5628 Description Clarke is a patient with multiple personality disorder. One day, he turned into a mathematician, did a research on interesting things. Suddenly he found a interesting fo…
版权声明:本文为博主原创文章.未经博主同意不得转载. https://blog.csdn.net/u011328934/article/details/26005267 题目链接:hdu 4803 Poor Warehouse Keeper 题目大意:有以个屏幕能够显示两个值,一个是数量x,一个是总价y. 有两种操作.一种是加一次总价,变成x,x+y:一种是加一个数量,这要的话总价也会对应加上一个的价钱.变成x+1.y+y/x.总价显示的为取整后的整数,小数部分忽略. 给定一个目标x.y.初始状…
Play the Dice Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65535/32768 K (Java/Others)Total Submission(s): 3648    Accepted Submission(s): 1181Special Judge Problem Description There is a dice with n sides, which are numbered from 1,2,...,…
1597: 薛XX后代的IQ Time Limit: 1 Sec  Memory Limit: 128 MBSubmit: 228  Solved: 55[Submit][Status][Web Board] Description 薛 XX的低IQ是个令人头疼的问题,他的队友深受其害.幸运的是,薛XX非常有钱,所以他买了一些可以提高他的后代的IQ的药.这种药有三个属性,A,B和 P.当薛XX使用这种药的时候,他的基因会发生变化,所以他的儿子的IQ也会跟着变化.假设薛XX的父亲的IQ为X,薛XX…
xiaoxin juju needs help 题目连接: http://acm.hdu.edu.cn/showproblem.php?pid=5651 Description As we all known, xiaoxin is a brilliant coder. He knew palindromic strings when he was only a six grade student at elementry school. This summer he was working a…