1. 程式人生 > >(hdu step 4.1.5)find the nth digit(求S串中的第n個位置上是什麼數字)

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

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

相關推薦

(hdu step 4.1.5)find the nth digit(Sn位置是什麼數字)

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

hdu 1957 find the nth digit

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

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>

find the nth digit HDU

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

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

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

假設: 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

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 ..................

(hdu step 7.1.7)Wall(凸包的周長——將全部點圍起來的最小凸多邊形的周長)

esp minimal gree follow inpu clas foo sed sig 題目:WallTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Tot

用for和while循環e的值[e=1+1/1!+1/2!+1/3!+1/4!+1/5!+...+1/n!]

主函數 int class urn log emp art print tracking /*編敲代碼,依據下面公式求e的值。要求用兩種方法計算: 1)for循環。計算前50項 2)while循環,直至最後一項的值小於10-4 e=1+1/1!+1/2!+1/

(hdu step 7.1.6)最大三角形(凸包的應用——在n找到3點,它們所形成的三角形面積最大)

三角形 struct names com 都在 acm sni 都是 tran 題目:最大三角形Time Limit: 5000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total S

HDU 多校1.5

family cto desc utili left where ane respond factors Expectation Division Time Limit: 6000/3000 MS (Java/Others) Memory Limit: 131072

MySQL 4.1/5.0/5.1/5.5/5.6各版本的主要區別

5.6 同步 一個表 bin ger err 各版本 擴展性 sed MySQL 4.1/5.0/5.1/5.5/5.6各版本的主要區別 一、5.0 增加了Stored procedures、Views、Cursors、Triggers、XA transactions的支持

計算1/1-1/2+1/3-1/4+1/5+……+1/99-1/100的值

看到這個式子首先總結規律: 1.每一項都是分數 2.分子都為1,分母依次遞增至100 3.分母的奇數項為正,偶數項為負 思路: 1.定義一個sum 2.建立一個迴圈,再判斷是否是奇數,如果是奇數往sum上加,否則(偶數)往sum上減 3.列印sum 程式碼如下: #include <s

paip jdk1 4 1 5 5 0 1 6 6 0 7 0 8 0特點比較與不同

分享一下我老師大神的人工智慧教程!零基礎,通俗易懂!http://blog.csdn.net/jiangjunshow 也歡迎大家轉載本篇文章。分享知識,造福人民,實現我們中華民族偉大復興!