HDU3269 P2P File Sharing System
来源:互联网 发布:python web和java web 编辑:程序博客网 时间:2024/05/16 09:18
http://acm.hdu.edu.cn/showproblem.php?pid=3269
09宁波。
模拟题。
#include <cstdio>#include <cstring>#include <cmath>#include <map>#include <set>#include <vector>#include <iostream>#include <cstdlib>#include <algorithm>#include <string>#include <queue>//#include <time1.h>#include <list>#include <stack>using namespace std;#define N 25#define M 1005int n,time1,k,size,m;int a[N][N];bool ser[N];struct machine{ int begt,v; bool work[M];}ma[N];void init(){ int i,j,m1,p,q; scanf("%d%d",&n,&time1); scanf("%d%d",&k,&size); for (i=1;i<=n;i++) ma[i].v=0; memset(ser,false,sizeof(ser)); for (i=1;i<=k;i++) { scanf("%d",&j); ser[j]=true; ma[j].v=size; } for (i=1;i<=n;i++) for (j=1;j<=n;j++) scanf("%d",&a[i][j]); for (i=1;i<=n;i++) { for (j=1;j<=time1;j++) ma[i].work[j]=false; scanf("%d",&m1); for (j=1;j<=m1;j++) { scanf("%d%d",&p,&q); p++; for (int kk=p;kk<=q;kk++) ma[i].work[kk]=true; } } scanf("%d",&m); for (i=1;i<=m;i++) { scanf("%d%d",&p,&q); ma[q].begt=p+1; }}int main(){ //freopen("a","r",stdin); int T,i,j,kk; scanf("%d",&T); while(T--) { init(); for (i=1;i<=time1;i++) { for (j=1;j<=n;j++) if (!ser[j] && i>=ma[j].begt && ma[j].work[i]) { for (kk=1;kk<=n;kk++) if (kk!=j && ser[kk] && ma[kk].work[i]) ma[j].v+=a[kk][j]; } for (j=1;j<=m;j++) if (ma[j].v>=size) { ser[j]=true; ma[j].v=size; } } for (i=1;i<=n;i++) printf("%d%%\n",(ma[i].v*100)/size); } return 0;}
- HDU3269 P2P File Sharing System
- ZOJ3277 POJ3836 HDU3269 P2P File Sharing System,二分图匹配
- poj 3836 P2P File Sharing System
- HDU 3269 P2P File Sharing System 模拟
- Implement p2p file sharing system with RMI
- hdu 3269 P2P File Sharing System(大模拟)
- POJ 3836 P2P File Sharing System 模拟客户机和服务器P2P传输过程
- 文献笔记3-large scale analysis of the edonkey p2p file sharing system
- Create a P2P file-sharing application
- Top 10 Most Popular P2P File Sharing Clients of 2010/2011
- Sharing The Application Tier File System in Oracle E-Business Suite Release 12.2
- Network File Sharing Services
- VBOX File sharing
- Sharing a File
- Sharing a File
- Setting Up File Sharing
- Setting Up File Sharing
- Sharing a File
- source insight 配置对php的支持
- [图]了解和使用Windows 8 必须要知道的4大新服务
- 如何在WORD页脚中设置这种页码格式
- MFC EDIT控件自动显示垂直滚动条
- 高斯函数及其各阶导数
- HDU3269 P2P File Sharing System
- struts2中的自定义类型转换器
- Service与Android系统设计(4)-- ServiceManager
- java对xml节点属性的添加和删除
- 【硬币君第一弹】HDU_1398_母函数
- 解决MyEclipse无法import/new project的问题
- VC项目配置详解
- 第八周上机任务之求两点间的距离
- session 用户退出 问题(转)