BiliBili, ACFun… And More!
来源:互联网 发布:ppt怎么弄数据展现 编辑:程序博客网 时间:2024/05/18 14:12
没错我又睡不着来码代码来了(=゚ω゚)ノ
这次这个题真是一点开就吓尿啊,他喵的全是英文啊有木有(╯`□′)╯┻━┻
算了,还是先上正文
算了,还是先上正文
C++语言: 高亮代码由发芽网提供
01 #include
02
03 using namespace std;
04
05 float js(float X,float Y,float T,float S){
06 if (X<=Y){
07 float t=S/X;
08 return t;
09 }
10 float t0=S/Y;
11 float t=T*Y/(X-Y);
12 float t_temp1=0;
13 float t_temp2=0;
14 while(t<(t0-T)){
15 t_temp1=t_temp2;
16 t_temp2=t;
17 t=t+(t+T)*Y/(X-Y);
18 }
19 t=t_temp2+S/X; //本来是像下面这样写的
20 return t;
31 }
32
33 int main(){
34 int N=0;
35 float X[1000]={0},Y[1000]={0},S[1000]={0},T[1000]={0};
36 int i;
37 cin>>N;
38 for (i=0;i
39 cin>>X[i]>>Y[i]>>T[i]>>S[i];
40 }
41 for (i=0;i
42 printf("Case #%d: %.3f\n",i+1,js(X[i],Y[i],T[i],S[i]));
43 }
44 }
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
19
20
31
32
33
34
35
36
37
38
39
40
41
42
43
44
这次用了差不多两个小时吧,读题就读了10多分钟啊妈蛋(╯`□′)╯┻━┻
总的来说还是比较简单,嗯,就是这样
看球去喽~
PS:第一次发表之后发现居然少了一截。。。所以的内容会被注释掉是么。。。。。。
PPS:新浪啥时候能添加一个插入代码的插件啊。。。
阅读全文
0 0
- BiliBili, ACFun… And More!
- acm-BiliBili, ACFun… And More!
- PROCESS J000 And …
- The Python Tutorial 4. More Con…
- Why ASMLIB and why not? <转载…
- How to Disable and Turn Off UAC …
- Simulate and use real GPS in WM …
- How do I get default date and ti…
- HDOJ 1028 Ignatius and the Pri…
- GSM900 and GSM1800 ARFCN Frequen…
- Introduction: Using diff and pat…
- Data References and Anonymous St…
- [Flex] Hierarchical and grouped …
- Thinkpad Rescue and Recovery 使…
- Bootloader and Uboot compiled, c…
- One or more secti…
- more the one WASS…
- One or more scree…
- HTML5新特性之文件和二进制数据的…
- 玩游戏的时候怎么没觉得补刀这么难…
- ffmpeg的转码延时测试与设置优化
- 8球胜负(eight)
- 使用ffmpeg对视频进行TS切片
- BiliBili, ACFun… And More!
- 七种转化RTSP屏显示到web页面的方…
- 点球大战(penalty)
- 对Class.forName()用法详解
- mac 安装node环境
- Android App自动化测试: OPEN-STF环境搭建
- [境内法规]中国人民银行关于进一步加强金融机构反洗钱工作的通知—银发[2008]391号
- 【转】xampp集成的mysql,插入中文…
- CentOS7 安装配置Redis数据库