HDU 5058(set) 5059 (字符串操作)
来源:互联网 发布:邪恶漫画网站源码免费 编辑:程序博客网 时间:2024/06/14 06:57
5058
#include <cstdio>#include <cstdlib>#include <cstring>#include <cmath>#include <ctime>#include <iostream>#include <algorithm>#include <vector>#include <set>#include <map>#include <stack>#include <queue>#define pi (acos(-1.0))#define eps (1e-6)#define inf (1<<28)#define mod 1000000007#define MAXN 110using namespace std;typedef long long LL;int main(){int i,j,k,num;set<int>A,B;while(cin>>k){A.clear();B.clear();for(i=1;i<=2*k;i++){scanf("%d",&num);if(i <= k)A.insert(num);elseB.insert(num);}printf(A==B?"YES\n":"NO\n");}return 0;}
5059
#include <cstdio>#include <cstdlib>#include <cstring>#include <cmath>#include <ctime>#include <iostream>#include <algorithm>#include <vector>#include <set>#include <map>#include <stack>#include <queue>#define pi (acos(-1.0))#define eps (1e-6)#define inf (1<<28)#define mod 1000000007#define MAXN 110using namespace std;typedef long long LL;int main(){int i,j,k,num;char str[110],s2[110];int len,res;int a,b,flag,ff;while(gets(str)){scanf("%d%d",&a,&b);getchar();num = atoi(str);//字符串转数字,遇到不是数字的就停止转换,输出能转换的itoa(num,s2,10);//数字转字符串,sprintf也行if(strcmp(s2,str) == 0 && num >=a && num <= b)cout<<"YES";elsecout<<"NO";cout<<endl;}return 0;}
0 0
- HDU 5058(set) 5059 (字符串操作)
- hdu 5058 set应用
- HDU 1020 Encoding 字符串操作
- Python的字符串,list,tuple,set,字典操作详解
- python学习—Day31—redis操作:字符串、list、set
- set操作
- set操作
- HDU 5058 So easy(STL set运用)
- HDU-#5058 So easy(set)
- hdu 5058 So easy (set)
- 七周一次课(11月27日) 13.5 字符串操作 13.6 list操作 13.7 set操作
- hdu 5059 简单字符串处理
- HDU 5059Help him(字符串)
- HDU 1558 Segment Set
- hdu 1558 Segment set
- hdu 1558 Segment set
- HDU 4631 set维护
- hdu 1558 Segment set
- mysql 慢查询分析工具:pt-query-digest 在mac 上的安装使用
- 一个少年的魔兽情怀
- HTTPS理论基础及其在Android中的最佳实践
- 使用OpenCV Android SDK从摄像头帧实时检测人脸
- Largest Number
- HDU 5058(set) 5059 (字符串操作)
- BZOJ·人生相关
- 求字符串的所有组合
- Javascript笔记整理 —— 提升
- python模块使用
- <Hadoop>Hadoop 2.7.2 集群安装
- list-style:none;
- UITextField、UITextView、UIWebViewd
- Python学习笔记(三)windows下安装theano