uva 10763 Foreign Exchange我认为我这种做法最符合题意!
来源:互联网 发布:淘宝特价裤子女 编辑:程序博客网 时间:2024/05/24 05:10
#include <cstdio>#include <cstring>#include <iostream>#include <algorithm>#include <vector>#include <queue>#include <set>#include <map>#include <string>#include <cmath>#include <climits>#include <cstdlib>#include <ctime>#include <stack>using namespace std;//freopen("out.txt","w",stdout);//freopen("in.txt","r",stdin);//ios::sync_with_stdio(false);struct node{int x,y;bool operator < (const node& a)const {if(x == a.x )return y < a.y;elsereturn x < a.x;}};node a[500005];node b[500005];int main(){int n;while(scanf("%d",&n),n){for(int i = 0;i < n;i++){scanf("%d%d",&a[i].x,&a[i].y);b[i].x = a[i].y;b[i].y = a[i].x;}sort(a,a+n);sort(b,b+n);int flag = 1;for(int i = 0;i < n;i++){if(memcmp(&a[i],&b[i],sizeof(node)) != 0){flag = 0;}}if(flag) printf("YES\n"); else printf("NO\n");}return 0;}
</pre><pre code_snippet_id="640726" snippet_file_name="blog_20150410_3_4436580" name="code" class="cpp">我认为这种方法才是最符合题意的,虽然这里面数据很差,但是这种做法才是比较正确的!
0 0
- uva 10763 Foreign Exchange我认为我这种做法最符合题意!
- UVa 10763 - Foreign Exchange
- UVa 10763 - Foreign Exchange
- uva 10763 - Foreign Exchange
- uva 10763 - Foreign Exchange
- Foreign Exchange uva 10763
- UVa 10763 - Foreign Exchange
- Uva-10763-Foreign Exchange
- UVa 10763 - Foreign Exchange
- UVa 10763 - Foreign Exchange
- UVa 10763: Foreign Exchange
- UVA 10763 Foreign Exchange
- UVa 10763 - Foreign Exchange
- uva 10763 - Foreign Exchange
- uva 10763 Foreign Exchange
- uva 10763 Foreign Exchange
- uva 10763 Foreign Exchange
- UVA 10763 Foreign Exchange
- PMP 学习之一:PMP五大过程组十大知识领域47个子过程
- 算法导论随笔(第2章)
- MySQL和Oracle Procedure和Function的区别
- 疯狂小象
- Yii 创建自己的扩展
- uva 10763 Foreign Exchange我认为我这种做法最符合题意!
- python使用@property
- ITOO中之controller的错误
- 记一次神秘的BUG
- Flume-源码-1
- CentOs 设置静态IP 方法
- 用PHP批量插入数据到MySQL中
- oracle数据库的基本命令
- 读<<程序设计实践>>