牛客网编程题结果是根据最后一次保存结果还是历史最高保存结果来

如题,俄罗斯套头程序之前ac了80%,最后修改程序 出错,但是没时间自动提交了
这种情况是算我 最后自动提交的结果吗?
全部评论
不会
点赞 回复 分享
发布于 2017-04-22 21:18
不会吧,应该算你上一次提交结果
点赞 回复 分享
发布于 2017-04-22 21:34
上一次的吧
点赞 回复 分享
发布于 2017-04-22 21:37
#include <iostream> #include <string> #include <vector> #include <algorithm> #include <map> using namespace std; struct Recta { int width; int height; Recta(int _w = 0, int _h = 0) :width(_w), height(_h) {}; }; bool m_comp(const Recta& a, const Recta& b) { if (a.width == b.width) { return a.height < b.height; } else { return a.width < b.width; } } int maxCount(int number, vector<Recta> datas) { int res = 1; int outW, outH; sort(datas.begin(), datas.end(), m_comp); //按照width升序排序 outW = datas[0].width; outH = datas[0].height; for (int i = 1; i < number; i++) { if (datas[i].width > outW && datas[i].height > outH) { res++; outW = datas[i].width; outH = datas[i].height; } } return res; } int main() { int number; Recta temp; while (cin>>number) { vector<Recta> datas(number); for (int i = 0; i < number; i++) { cin >> temp.width >> temp.height; datas[i] = temp; } cout << maxCount(number,datas) << endl; } //system("pause"); return 0; }
点赞 回复 分享
发布于 2017-04-23 07:52
最高通过比例算分
点赞 回复 分享
发布于 2017-04-23 12:10

相关推荐

2024-12-05 18:57
已编辑
吉林大学 Java
张伟要好好学习:这么巧的,我叫安赛龙,祝贺兄弟
点赞 评论 收藏
分享
2024-12-16 19:50
已编辑
香港中文大学 前台
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客企业服务