Joe周鸟 2014-12-19 11:27 采纳率: 50%
浏览 755

ACM hdoj1084测试了很多数据,提交就wa

http://acm.hdu.edu.cn/showproblem.php?pid=1084
代码如下
#include
#include
using namespace std;
struct score{
int p;
string t;
};
int main()
{
int t;
while(cin>>t && t>=0){
score sco[100];
// memset(sco,0,sizeof(sco));
for(int i=0;i sco[i].t.clear();
cin>>sco[i].p>>sco[i].t;
}
for(int i=0;i bool flag = true;
int first=0,last=0;
for(int j=0;j if(sco[i].p==sco[j].p&&sco[i].t first ++;
}
if(sco[i].p==sco[j].p&&sco[i].t>sco[j].t){
last++;
}
if(first<=last&&first+last!=0)
flag = false;
}
if(flag==true){
if(sco[i].p == 5)
cout<<"100"<<endl;
else if(sco[i].p == 0)
cout<<"50"<<endl;
else
cout<<(sco[i].p+5)*10 +5<<endl;
}
else{
if(sco[i].p == 5)
cout<<"100"<<endl;
else if(sco[i].p == 0)
cout<<"50"<<endl;
else
cout<<(sco[i].p+5)*10<<endl;
}
}
cout<<endl;
}
return 0;
}

  • 写回答

0条回答

    报告相同问题?

    悬赏问题

    • ¥15 解决一个加好友限制问题 或者有好的方案
    • ¥15 关于#java#的问题,请各位专家解答!
    • ¥15 急matlab编程仿真二阶震荡系统
    • ¥20 TEC-9的数据通路实验
    • ¥15 ue5 .3之前好好的现在只要是激活关卡就会崩溃
    • ¥50 MATLAB实现圆柱体容器内球形颗粒堆积
    • ¥15 python如何将动态的多个子列表,拼接后进行集合的交集
    • ¥20 vitis-ai量化基于pytorch框架下的yolov5模型
    • ¥15 如何实现H5在QQ平台上的二次分享卡片效果?
    • ¥30 求解达问题(有红包)