POJ 1581
来源:互联网 发布:java微信商城 编辑:程序博客网 时间:2024/05/20 21:44
//对ACM进行裁判,计算出胜出冠军
//POJ 1581
#include<iostream>
#include<string>
using namespace std;
int main()
{
string wname , name; //冠军名字 当前队名
int wsol=0, sol; //解题数 当前解题数
int wpt=0,pt; //罚时 当前罚时
int sub,time; // 提交次数 解题时间
int n; //参赛队伍
cin>>n;
for(int i=0;i<n;++i)
{
pt=0;
sol=0;
cin>>name;
for(int j=0;j<4;++j) //计算当前队伍的分数
{
cin>>sub>>time;
if(0!=time)
{
++sol;
pt+=(sub-1)*20+time;
}
}
if((sol>wsol)||(sol==wsol&&wpt>pt)) //确定当前冠军
{
wname=name;
wsol=sol;
wpt=pt;
}
}
cout<<wname<<" "<<wsol<<" "<<wpt<<endl;
return 0;
}
//POJ 1581
#include<iostream>
#include<string>
using namespace std;
int main()
{
string wname , name; //冠军名字 当前队名
int wsol=0, sol; //解题数 当前解题数
int wpt=0,pt; //罚时 当前罚时
int sub,time; // 提交次数 解题时间
int n; //参赛队伍
cin>>n;
for(int i=0;i<n;++i)
{
pt=0;
sol=0;
cin>>name;
for(int j=0;j<4;++j) //计算当前队伍的分数
{
cin>>sub>>time;
if(0!=time)
{
++sol;
pt+=(sub-1)*20+time;
}
}
if((sol>wsol)||(sol==wsol&&wpt>pt)) //确定当前冠军
{
wname=name;
wsol=sol;
wpt=pt;
}
}
cout<<wname<<" "<<wsol<<" "<<wpt<<endl;
return 0;
}
- POJ 1581
- poj-1581
- POJ
- poj
- POJ
- POJ
- poj
- poj
- POJ
- POJ
- poj
- POJ
- POJ
- POJ
- POJ
- POJ
- POJ
- POJ
- Android 【SDK目录结构】、【源码sources目录结构】及【如何在eclipse中查看源码】
- 把二叉搜索树变成一个二叉树,使得原来每个节点的值 变成 (原来的值+所有大于它的值的和)
- linux下的C
- 大考:城市化
- Transform - Functions
- POJ 1581
- HDU 1076 An Easy Task
- 新鲜出炉:基于HTML5的jquery文件上传插件(多文件选择、带进度条、完整可用)
- cocos2d-x 自建动画管理器AnimationManager的方法和使用
- ARM Linux中断机制分析
- 文档流
- 在CentOS下安装php的json扩展 PHP Fatal error: Call to undefined function json_decode()
- Android 应用程序基础知识(2)
- Linux下C和C++开发基础