HDU 3233 - Download Manager
来源:互联网 发布:刘慧芳 知乎 编辑:程序博客网 时间:2024/05/17 02:38
一道很令人无语的题,一开始打算用模拟,后来发现……汗啊,题目给出等待n个下载的任务,每次能同时下载的任务K,下载的速度B,然后给出n个任务的总大小和已下载的百分比,要求出所有任务下载完成的最小时间;其实这道题只需要理解成:用B的速度下载n个文件所有剩余的大小总和,因为题目要求,一个文件下载完成后,他所分得的流量,马上分给其他的文件,也就是说在下载期间一直保持B的速度,理解这一点后就简单了;
AC code :
#include<cstdio>
int main()
{
int T,n,B,b,t=1;
while(scanf(\"%d%d%d\",&T,&n,&B)&&T)
{
double a,sum=0.0;
for(int i=1;i<=T;i++)
{
scanf(\"%lf%d\",&a,&b);
sum+=a*(100-b)/100;
}
printf(\"Case %d: %.2lf\\n\\n\",t++,sum/B);
}
return 0;
}
AC code :
#include<cstdio>
int main()
{
int T,n,B,b,t=1;
while(scanf(\"%d%d%d\",&T,&n,&B)&&T)
{
double a,sum=0.0;
for(int i=1;i<=T;i++)
{
scanf(\"%lf%d\",&a,&b);
sum+=a*(100-b)/100;
}
printf(\"Case %d: %.2lf\\n\\n\",t++,sum/B);
}
return 0;
}
- HDU 3233 - Download Manager
- HDU 3233 Download Manager
- HDU 3233 Download Manager
- HDU 3233 Download Manager
- hdu 3233 Download Manager(模拟题)
- HDU 3233 Download Manager [双向链表]
- Maxthon Download Manager
- Internet Download Manager 5.05
- Download Manager notes
- android download manager用法
- oracle access manager download
- Internet Download Manager
- Internet Download Manager v5.03
- Internet Download Manager ver.5.04
- IE custom download manager (IEDownloadManager)
- android的download manager(1)
- android Download Manager被禁用
- 3233 Download Manager //2009 Asia Wuhan Regional Contest Hosted by Wuhan University
- UVA 10115 - Automatic Editing
- HDU 2909 - Expected Allowance
- 123 - Searching Quickly
- UVA 107 - The Cat in the Hat
- HDU 1969 - Pie
- HDU 3233 - Download Manager
- UVA 755 - 487--3279
- UVA 10785 - The Mad Numerologist
- 10014 - Simple calculations
- 10719 - Quotient Polynomial
- UVA 550 - Multiplying by Rotation
- UVA 375 - Inscribed Circles and Isosceles Triangles
- UVA 10387 - Billiard
- UVA 11234 - Expressions