1. 程式人生 > >find the nth digit

find the nth digit

假設:
S1 = 1
S2 = 12
S3 = 123
S4 = 1234
.........
S9 = 123456789
S10 = 1234567891
S11 = 12345678912
............
S18 = 123456789123456789
..................
現在我們把所有的串連線起來
S = 1121231234.......123456789123456789112345678912.........
那麼你能告訴我在S串中的第N個數字是多少嗎?

相關推薦

hdu 1957 find the nth digit

假設: S1 = 1 S2 = 12 S3 = 123 S4 = 1234 ......... S9 = 123456789 S10 = 1234567891 S11 = 12345678912 ............ S18 = 123456789123456789 ..............

HDU1597 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): 1597

find the nth digit HDU - 1597 二分 思維

題解 打表計算1+2+3+…+N的所有和 二分查詢到第一個小於N的那個和 N減去他 接下來就是9個一迴圈 N = (N - 1) % 9 + 1得到是哪個數字 AC程式碼 #include <stdio.h> #include <bits/stdc++.h>

(hdu step 4.1.5)find the nth digit(求S串中的第n個位置上是什麼數字)

假設:S1 = 1S2 = 12S3 = 123S4 = 1234.........S9 = 123456789S10 = 1234567891S11 = 12345678912............S18 = 123456789123456789..................現在我們把所有的串連線起

find the nth digit HDU

假設:  S1 = 1  S2 = 12  S3 = 123  S4 = 1234  .........  S9 = 123456789  S10 = 1234567891  S11 = 12345678912  ............  S18 = 123456789123456789  ........

find the nth digit

假設: S1 = 1 S2 = 12 S3 = 123 S4 = 1234 ......... S9 = 123456789 S10 = 1234567891 S11 = 12345678912 ............ S18 = 123456789123456789 ..................

find the nth digit(數論)

假設: S1 = 1 S2 = 12 S3 = 123 S4 = 1234 ......... S9 = 123456789 S10 = 1234567891 S11 = 12345678912

hd 1597 find the nth digit(解決超時的牛氣哄哄的新辦法)

<h1 style="COLOR: #1a5cc8"><div class="panel_title" align="left"><h1 style="COLOR: #1a5cc8">find the nth digit</h1&g

Step5. 專題 1.ACM模擬 HDU1597 find the nth digit【模擬】

先查詢是第幾行,然後對9取餘即可。 注意,i從1開始尋找時,程式碼雖然簡介,但是不好,有風險。查詢的過程耗時太大。 程式碼1(模擬的方式,不推薦) 這兩次提交的是程式碼1,第二次提交還加了cin 優化,結果時間卻更長了。 #include<iostrea

hdu 1597 find the nth digit

Problem Description 假設: S1 = 1 S2 = 12 S3 = 123 S4 = 1234 ......... S9 = 123456789 S10 = 1234567891

HDU 1597 find the nth digit

題目: Description 假設:  S1 = 1  S2 = 12  S3 = 123  S4 = 1234  .........  S9 = 123456789  S10 = 1234

find the nth digit(數論)

假設: S1 = 1 S2 = 12 S3 = 123 S4 = 1234 ......... S9 = 123456789 S10 = 1234567891 S11 = 12345678912 ............ S18 = 123456789123456789 .......

杭電acm1597 find the nth digit

假設: S1 = 1 S2 = 12 S3 = 123 S4 = 1234 ......... S9 = 123456789 S10 = 1234567891 S11 = 12345678912 ............ S18 = 123456789123456789 ..................

Martyr2專案實現——Number部分的問題求解 (1) Find Pi to Nth Digit

## 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 progra

F - Find The Bone

.com col unit table 輸入 mce 每次 move each F - Find The Bone Zane the wizard is going to perform a magic show shuffling the cups. There are

關於jmeter命令行執行.jmx文件出現Error in NonGUIDriver java.lang.RuntimeException: Could not find the TestPlan class的問題

使用 lang exception ava 出現 問題 drive test bug jmeter命令行執行.jmx文件時,有時回出現Error in NonGUIDriver java.lang.RuntimeException: Could not find the T

算法(9)Find the Duplicate Number

lee leetcode 題目 但是 ron ont 拼圖遊戲 裏的 要求 一個數組中的長度是n+1,裏面存放的數字大小的範圍是【1,n】,根據鴿巢原理,所以裏面肯定有重復的數字,現在預定重復的數字就1個,讓你找到這個數字! http://bookshadow.com/we

MyEclipse運行Java出錯:could not find the main class:test.program will exit(導入項目)

沒有 fin run lib could not sys program pil 編譯器 自己新建的項目運行沒有任何問題。但是我導入的很早以前別人寫的項目,然後run就會彈框could not find the main class:test.program will ex

[LeetCode] Find the Closest Palindrome 尋找最近的回文串

bsp ren present diff absolut tco zed ret turn Given an integer n, find the closest integer (not including itself), which is a palindro

hdoj 1596 find the safest road

mission 能夠 trac tdi sub -a 代碼 tracking spf find the safest road Time Limit: 10000/5000 MS (Java/Others) Memory Limit: 32768/32768 K