HDU-5984-Pocky
描述
題解
這場比賽的期望概率成分好高,挺不順手。
不過這個題的程式碼倒是很簡單,強勢猜公式推結論。
程式碼
#include <iostream>
#include <cstdio>
#include <cmath>
using namespace std;
double L, d;
int main()
{
int N;
cin >> N;
while (N--)
{
cin >> L >> d;
if (L <= d)
{
cout << "0.000000\n";
}
else
{
printf("%.6f\n", 1 + log(L / d));
}
}
return 0;
}
相關推薦
HDU 5984 Pocky 數學期望
Pocky Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 2004 Accepted Submissio
HDU 5984 Pocky (概率+簡單微分方程)
#include<bits/stdc++.h> using namespace std; #define debug puts("YES"); #define rep(x,y,z) for(int (x)=(y);(x)<(z);(x)++) #def
hdu 5984 Pocky (16青島現場賽)找規律
int main() { int T; cin>>T; while(T--) { double x,y; cin>>x>>y; if(x<=y)cout
HDU-5984-Pocky
ACM模版 描述 題解 這場比賽的期望概率成分好高,挺不順手。 不過這個題的程式碼倒是很簡單,強勢猜公式推結論。ans=1+log(L/d),L>d 程式碼 #includ
HDU 5984 Pocky
Pocky Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 689 Accepted Submissi
HDU 5984 Pocky
http://acm.hdu.edu.cn/showproblem.php?pid=5984 似乎青島2016icpc的概率題很多,但這道題是看樣例看出來的。。。 輸入L和d, 求一根pocky每
HDU 5984 數學期望
define eps else 區域 比較 double scan clu file 對長為L的棒子隨機取一點分割兩部分,拋棄左邊一部分,重復過程,直到長度小於d,問操作次數的期望。 區域賽的題,比較基礎的概率論,我記得教材上有道很像的題,對1/len積分,$ln(L)-
HDU 5984(求木棒切割期望 數學)
長度 std put pri hdu art \n 技術 open 題意是給定一長為 L 的木棒,每次任意切去一部分直到剩余部分的長度不超過 D,求切割次數的期望。 若木棒初始長度不超過 D,則期望是 0.000000; 設切割長度為 X 的木棒切割次數的期望是 F(X
hdu 5984
Pocky Problem Description Let’s talking about something of eating a pocky. Here is a Decorer Pocky, with colorful decorative stri
hdu 4719 Oh My Holy FFF(dp線段樹優化)
origin end should adding href ast left code padding Oh My Holy FFF Time Limit: 5000/2500 MS (Java/Others) Memory Limit: 65535/65535
HDU 1087 Super Jumping! Jumping! Jumping!
blog col som oss score ++ all you finall Nowadays, a kind of chess game called “Super Jumping! Jumping! Jumping!” is very popular in HDU.
HDU 1114 Piggy-Bank(完全背包)
ask style span ica ace eno eterm ++ empty 題目: Before ACM can do anything, a budget must be prepared and the necessary financial support o
Hdu-1072
std bits -1 簡單 pty one int 個數字 一行 題目描述: 首先輸入一個N;代表測試數據的個數; 然後每個測試數據的開頭第一行輸入一個n和一個命令(FIFO或FILO<就是先進先出或先進後出>) 然後是該測試數據的n行,每行包括“IN”加一個
hdu 1284 錢幣兌換問題
print class mat 題目 能夠 ims 遞推 detail acm 題目鏈接:http://acm.hdu.edu.cn/showproblem.php?pid=1284 思路:僅僅有3個硬幣,範圍是32768。能夠一個一個枚舉硬幣。假設僅僅放價值為1的硬幣
HDU 2648(搜索題,哈希表)
cin ostream pac cstring using mem == ring scan #include<iostream> #include<map> #include<string> #include<cstring&
hdu 5078
fine title tle only asi art it is text 現場 Osu! Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 262144/262144 K (Java/Others) T
HDU 2112 HDU Today(STL MAP + Djistra)
stl eof dji int ble mes tin std n) 題目鏈接:HDU Today 立即集訓要開始,抓緊時間練練手,最短路的基礎題,第一次用STL的map 題目非常水,可是錯了N遍。手賤了。本題不優點理的就是把地名轉化為數字 #include
Super Jumping! Jumping! Jumping! HDU - 1087
std idt scribe cas abs roc assume led cor Nowadays, a kind of chess game called “Super Jumping! Jumping! Jumping!” is very popular in HDU
最大連續子序列 HDU - 1231
bsp 最大 程序 結構 %d col 最小 元素 class 給定K個整數的序列{ N1, N2, ..., NK },其任意連續子序列可表示為{ Ni, Ni+1, ..., Nj },其中 1 <= i <= j <= K。最大連續子序列是所有連續子
HDU 4930 Fighting the Landlords(扯淡模擬題)
href blank 。。 clear break 輸出 family fig set Fighting the Landlords 大意: 鬥地主。。。。 分別給出兩把手牌,肯定都合法。每張牌大小順序是Y (i.e. colored Joker) &g