多多色-多人伦交性欧美在线观看-多人伦精品一区二区三区视频-多色视频-免费黄色视屏网站-免费黄色在线

國內最全IT社區平臺 聯系我們 | 收藏本站
阿里云優惠2
您當前位置:首頁 > 互聯網 > POJ 3300 Tour de France(簡單題)

POJ 3300 Tour de France(簡單題)

來源:程序員人生   發布時間:2014-10-16 11:54:05 閱讀次數:3352次

【題意簡述】:由The drive ratio -- the ratio of the angular velocity of the pedals to that of the wheels -- isn : m where n is the number of teeth on the rear sprocket andm is the number of teeth on the front sprocket. Two drive ratios d1< d2 are adjacent if there is no other drive ratio d1 < d3 < d2. The spread between a pair of drive ratiosd1 < d2 is their quotient: d2 ?d1. You are to compute the maximum spread between two adjacent drive ratios achieved by a particular pair of front and rear clusters.我們可以知道,這個ratios等于n/m,然后d(從1……n)就是每一個ratios的值,現在讓我們求最大的di/d(i-1)的值。

【分析】:有些題就是這樣,只要我們理解了題意就可以很快的A掉,但如果不理解題意,就……

代碼借鑒:http://www.cnblogs.com/eric-blog/archive/2011/06/01/2067441.html

//236K 16Ms #include<iostream> #include<cstdio> #include<algorithm> using namespace std; using namespace std; double ratio[100]; int f,r; double front[10],rear[10]; double max_ratio; int index; int main() { while(cin>>f,f) { cin>>r; for(int i=0; i<f; i++) cin>>front[i]; for(int i=0; i<r; i++) cin>>rear[i]; index=0; for(int i=0; i<r; i++) { for(int j=0; j<f; j++) { ratio[index++]=rear[i]/front[j]; } } sort(ratio,ratio+index); for(int i=0; i<index-1; i++) ratio[i]=ratio[i+1]/ratio[i]; max_ratio=0.0; for(int i=0; i<index-1; i++) { if(max_ratio<ratio[i]) max_ratio=ratio[i]; } printf("%.2f ",max_ratio); } return 0; }



生活不易,碼農辛苦
如果您覺得本網站對您的學習有所幫助,可以手機掃描二維碼進行捐贈
程序員人生
------分隔線----------------------------
分享到:
------分隔線----------------------------
關閉
程序員人生
主站蜘蛛池模板: 91亚洲国产成人久久精品网址 | 亚洲精品主播一区二区三区 | 国产亚洲欧美ai在线看片 | 国产精品麻豆高清在线观看 | 中文字幕2021 | 九九精品视频一区二区三区 | a级毛毛片看久久 | 欧美亚洲韩国 | 欧美高清videos36opsexhd | 亚洲欧美人成人综合在线50p | 亚洲国产福利精品一区二区 | 欧美性猛交xxxxx按摩欧美 | 欧美一区二区在线播放 | 欧美一区二区在线免费观看 | 在线成h人视频网站免费观看 | 亚洲伊人色综合网站小说 | 在线高清观看 | 国内精神品一区区 | 国产精品免费综合一区视频 | 波多野结衣与老人公gvg在线 | 一本久道久久综合中文字幕 | 亚洲在线观看网站 | 久久久久久综合一区中文字幕 | 日本免费第一区二区三区 | 亚洲天堂视频在线免费观看 | 国产成人欧美一区二区三区的 | 欧洲性xxx | 亚洲精品一区二 | 亚洲免费福利视频 | 小说区 | 日本不卡免费新一二三区 | 午夜三级三级三点在线 | 港台无码 | 中国精品视频 | 日本一区二区视频在线观看 | 中文字幕视频网 | 亚洲精品久久一区影院 | 亚洲欧美一区二区三区另类 | 中文字幕中韩乱码亚洲大片 | 国产成人高清精品免费5388密 | 456在线|