nyoj +set的使用重写了排序函数
来源:互联网 发布:微课制作软件下载 编辑:程序博客网 时间:2024/04/29 23:11
点击打开链接
#include<iostream>#include<stdio.h>#include<stdlib.h>#include<string>#include<cstring>#include<string.h>#include<set>#include<algorithm>using namespace std;struct Node{int num, len, wid;};set<Node>s;bool operator<(Node x, Node y){return x.num<y.num || x.num == y.num && x.len<y.len || x.num == y.num&&x.len == y.len &&x.wid<y.wid;}int main(){int n, m, a, b, c;scanf("%d", &n);while (n--){scanf("%d", &m);while (m--){scanf("%d%d%d", &a, &b, &c);Node temp;if (b<c){temp.num = a, temp.len = c, temp.wid = b;s.insert(temp);}else{temp.num = a, temp.len = b, temp.wid = c;s.insert(temp);}}set<Node>::iterator it;for (it = s.begin(); it != s.end(); it++){printf("%d %d %d\n",it->num,it->len,it->wid);}s.clear();}return 0;}
0 0
- nyoj +set的使用重写了排序函数
- nyoj+排列使用了next_permutation函数
- 重写属性的set方法
- set容器_自定义数据类型排序(仿函数应用)_insert判断返回值(pair的使用)
- 重写Oracle的wm_concat函数,以自定义分隔符、排序
- swift 取消了 所有SetXXX 只能通过重写frame的set方法
- Android Studio自动生成get,set,tostring,构造函数及重写父类的方法
- NYOJ:奇怪的排序
- Python中set函数的使用
- Matlab中set-gca函数的使用
- C++中关于set的自定义排序函数的书写
- STL set,map , priority_queue 及 lower_bound 的排序比较函数
- 函数的重写
- strcmp函数的重写
- atio函数的重写
- 函数的重写特性
- create 函数的重写
- atoi函数的重写
- 为什么要对测试过程进行详细记录?
- mysql 禁用和启用外键
- UIPageControl和UIScrollView的联合使用
- phpstorm常用快捷键【2】
- Git解决代码冲突
- nyoj +set的使用重写了排序函数
- spring mvc的@manytoone
- Gstreamer 控制流
- Linux下查看文件和文件夹大小
- socket阻塞与非阻塞,同步与异步、I/O模型
- 将博客搬至CSDN
- load预加载简单实现
- 利用SQL生成xml示例
- Bug是怎样产生的之我见