HDU 6033 Add More Zero (數學)
題目鏈接:https://vjudge.net/problem/HDU-6033
這水題好難想。。。。。。
題意:給一個數m,求一個數k滿足10^k小於等於2^m-1。
這題其實是簡單的公式化簡:
= 10^k <= 2^m-1
= 10^k < 2^m
= ln10^k < ln 2^m
= k*ln10 < m*ln2
= k < m*1n2/1n10
代碼:
int main() { int cnt=0,m; while(cin>>m) { int ans=m*log(2)/log(10);//不要用for循環查找,否則超時printf("Case #%d: %d\n",++cnt,ans); } return 0; }
HDU 6033 Add More Zero (數學)
相關推薦
HDU 6033 Add More Zero (數學)
uri div ans nbsp 代碼 化簡 否則 鏈接 簡單的 題目鏈接:https://vjudge.net/problem/HDU-6033 這水題好難想。。。。。。 題意:給一個數m,求一個數k滿足10^k小於等於2^m-1。 這題其實是簡單的公式化簡: =
HDU-6033 Add More Zero
lin all term oss imu define cor hdu range There is a youngster known for amateur propositions concerning several mathematical hard proble
17 多校1 Add More Zero 水題
positive term each blog size cst without ces code Problem Description There is a youngster known for amateur propositions concerning seve
hdu 1066 Last non-zero Digit in N! 數學,求n!最後一位非零數
題意:求n!的最後一位非零數。(n很大,需要字元輸入) 題解: 我們發現n!末尾的0都是通過5和2想成得到的,我們將n分成20個數一組,最後剩下不足20個數。我們來討論【1-20】這20個數中含有5的數,只有5,10,15,20是5的倍數,我們還要找4個2來使之乘積得到10
HDU 5056 Boring count(數學)
log class == contain bold sea d+ const first 題目鏈接:http://acm.hdu.edu.cn/showproblem.php?pid=5056 Problem Description You are given
HDU 5844 LCM Walk(數學逆推)
起點 namespace ++ div pac href ace 通過 hdu http://acm.hdu.edu.cn/showproblem.php?pid=5584 題意: 現在有坐標(x,y),設它們的最小公倍數為k,接下來可以移動到(x+k,y)或者(x,y
【HDU 1856】More is better (裸並查集+記錄秩)
gin main 並查集 keep better sele scan ted dia Description Mr Wang wants some boys to help him with a project. Because the project is rather
2016女生賽 HDU 5710 Digit-Sum(數學,思維題)
accep ger sizeof memory fin left total src view Digit-Sum Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65535/32768 K (Java/Oth
HDU 1273 漫步森林(數學 找規律)
n-1 pac ron break ++ inpu don its can 傳送門: http://acm.hdu.edu.cn/showproblem.php?pid=1273 漫步森林 Time Limit: 2000/1000 MS (Java/Others)
HDU 2162 Add ‘em
panel mos sample contain generate ane highlight href space http://acm.hdu.edu.cn/showproblem.php?pid=2162 Problem Description Write a p
hdu 1561 The more, The Better【樹形揹包】
題目連結:http://acm.hdu.edu.cn/showproblem.php?pid=1561 The more, The Better Time Limit: 6000/2000 MS (Java/Others) Memory Limi
hdu 5584 LCM Walk(數學)
一個x,y只能向上向右走lcm(x,y)個單位。問有多少個不同的起點,能夠走到給出的x,y點上 打表發現,到達x,y的答案等於到達x/gcd,y/gcd的答案 那麼我們就能把x,y變成互質關
hdu 6217 BBP Formula(數學問題)
BBP Formula Time Limit: 16000/8000 MS (Java/Others) Memory Limit: 262144/262144 K (Java/Others) Total Submission(s): 351 Accepted S
HDU 1561 The more, The Better(樹形DP+01揹包)
題目連結 題意(這好像是中文題,不會別的語言=_=||) 思路 我們以0為根節點向外建樹,以前置點為起點,該點為終點,該點價值為線的權值。 由於每個結點只有一個父節點,每點權值等價兩點之間線上的權值。
HDU 5944 Fxx and string(數學)
問題描述 青年理論電腦科學家Fxx得到了一個只包含小寫字母的字串。 字串的長度為\:nn,下標從1開始,第\:i\:i位的字母為\:s_isi,現在Fxx想知道有多少三元組\:(i,j,k)
Add More IP Addresses to a Subnet
If subnets in your VPC run out of available IP addresses, AWS resources, such as load balancers, might not respond successfully to increased tr
External Share: Add more info please
so if P8 is setup as VMM the feature external share is currently not possible. Might be worth an separate post/questions here but does I
[HDU](5698)瞬間移動 ---- 組合數學(組合數)
有一個無限大的矩形,初始時你在左上角(即第一行第一列),每次你都可以選擇一個右下方格子,並瞬移過去(如從下圖中的紅色格子能直接瞬移到藍色格子),求到第n行第m列的格子有幾種方案,答案對1000000007取模。 Input 多組測試資料。 兩個
hdu-1561 The more, The Better (樹形dp入門,有依賴的揹包問題
The more, The Better Time Limit: 6000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 4954
HDU 5245 染色問題(數學期望)
Joyful Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 478 Accepted Submis