科大讯飞 球赛 0%过

感觉把所有都考虑了,包括积分相同考虑净胜球,净胜球数相同考虑总进球数
但是,实在不懂为什么一直是0%,贴上代码
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <utility>
#include <algorithm>

using namespace std;

int n;
vector<string> clubs;
vector<pair<string, vector<int>> > newclubs;    // vector jf p-n p
map<string, vector<int>> cnts;

bool Cmp(pair<string, vector<int>> mp1, pair<string, vector<int>> mp2)
{     if (mp1.second[0] > mp2.second[0])         return true;     if (mp1.second[0] == mp2.second[0])     {         if (mp1.second[1] > mp2.second[1])             return true;         if (mp1.second[1] == mp2.second[1])             if (mp1.second[2] > mp2.second[2])                 return true;     }     return false;
}

void GetNewClub()
{     clubs.clear();     newclubs.clear();     cnts.clear();     cin >> n;     clubs = vector<string>(n, "");     int i;     string ab, a, b, xy;     string x, y;     char fg = '-';     char fg2 = ':';     for (i = 0; i < n; i++)     {         cin >> clubs[i];         cnts.insert(make_pair(clubs[i], vector<int>(3, 0)));     }     for (i = 0; i < n*(n-1)/2; i++)     {         cin >> ab >> xy;         int posi = ab.find(fg);         a = ab.substr(0, posi);         b = ab.substr(posi+1);         int posi2 = xy.find(fg2);         x = xy.substr(0, posi2);         y = xy.substr(posi2+1);         if (x > y)         {             cnts[a][0] += 3;             cnts[a][1] += atoi(x.c_str())-atoi(y.c_str());             cnts[a][2] += atoi(x.c_str());             cnts[b][1] += atoi(y.c_str())-atoi(x.c_str());             cnts[b][2] += atoi(y.c_str());         }         else if (x < y)         {             cnts[a][1] += atoi(x.c_str())-atoi(y.c_str());             cnts[a][2] += atoi(x.c_str());             cnts[b][0] += 3;             cnts[b][1] += atoi(y.c_str())-atoi(x.c_str());             cnts[b][2] += atoi(y.c_str());         }         else         {             cnts[a][0] += 1;             cnts[a][1] += atoi(x.c_str())-atoi(y.c_str());             cnts[a][2] += atoi(x.c_str());             cnts[b][0] += 1;             cnts[b][1] += atoi(y.c_str())-atoi(x.c_str());             cnts[b][2] += atoi(y.c_str());         }     }     for (auto &a : cnts)         newclubs.push_back(make_pair(a.first, a.second));     sort(newclubs.begin(), newclubs.end(), Cmp);         clubs.clear();     for (i = 0; i < n/2; i++)         clubs.push_back(newclubs[i].first);          sort(clubs.begin(), clubs.end());     for (auto &a : clubs)         cout << a << endl;     return;
}

int main()
{     while (1)     {         GetNewClub();     }         return 0;
}

全部评论
百度搜索净胜球就知道了
点赞 回复 分享
发布于 2017-09-16 17:23
我也是,本地都测试通过,提交就显示输出超过什么的,烦人
点赞 回复 分享
发布于 2017-09-16 17:15
因为最后输出是按字母顺序,而不是得分顺序。  我也是做完才发现这个问题。
点赞 回复 分享
发布于 2017-09-16 17:13
大兄弟排下版啊
点赞 回复 分享
发布于 2017-09-16 17:13
百分之零的飘过 同样不知道错误原因
点赞 回复 分享
发布于 2017-09-16 17:12

相关推荐

评论
点赞
收藏
分享

创作者周榜

更多
正在热议
更多
# 春招至今,你的战绩如何? #
10354次浏览 92人参与
# 你的实习产出是真实的还是包装的? #
1836次浏览 42人参与
# 米连集团26产品管培生项目 #
5904次浏览 215人参与
# 军工所铁饭碗 vs 互联网高薪资,你会选谁 #
7541次浏览 43人参与
# 简历第一个项目做什么 #
31647次浏览 333人参与
# 重来一次,我还会选择这个专业吗 #
433425次浏览 3926人参与
# 巨人网络春招 #
11320次浏览 223人参与
# 当下环境,你会继续卷互联网,还是看其他行业机会 #
187075次浏览 1122人参与
# 牛客AI文生图 #
21421次浏览 238人参与
# 不考虑薪资和职业,你最想做什么工作呢? #
152340次浏览 887人参与
# 研究所笔面经互助 #
118892次浏览 577人参与
# 简历中的项目经历要怎么写? #
310190次浏览 4205人参与
# AI时代,哪些岗位最容易被淘汰 #
63596次浏览 814人参与
# 面试紧张时你会有什么表现? #
30502次浏览 188人参与
# 你今年的平均薪资是多少? #
213065次浏览 1039人参与
# 你怎么看待AI面试 #
180008次浏览 1245人参与
# 高学历就一定能找到好工作吗? #
64323次浏览 620人参与
# 你最满意的offer薪资是哪家公司? #
76476次浏览 374人参与
# 我的求职精神状态 #
448031次浏览 3129人参与
# 正在春招的你,也参与了去年秋招吗? #
363355次浏览 2638人参与
# 腾讯音乐求职进展汇总 #
160628次浏览 1111人参与
# 校招笔试 #
470789次浏览 2964人参与
牛客网
牛客网在线编程
牛客网题解
牛客企业服务