【链接】 我是链接,点我呀:)

【题意】

在这里输入题意

【题解】

先枚举一个数字的情况。
再枚举两个数的情况就好。

【代码】

#include <bits/stdc++.h>
#define ll long long
using namespace std; const int N = 20; int a[N],b[N],n,m; int main()
{
//freopen("F:\\rush.txt","r",stdin);
scanf("%d%d",&n,&m);
for (int i = 1;i <= n;i++)
{
int x;
scanf("%d",&x);
a[x]++;
}
for (int i = 1;i <= m;i++)
{
int x;
scanf("%d",&x);
b[x]++;
}
for (int i = 1;i <= 9;i++)
if (a[i]>0&&b[i]>0)
{
printf("%d\n",i);
return 0;
}
for (int i = 1;i <= 9;i++)
for (int j = 1;j <= 9;j++)
if ( (a[i]>0 || a[j]>0) && (b[i]>0||b[j]>0))
{
printf("%d\n",i*10+j);
return 0;
}
return 0;
}

【Codeforces Round #440 (Div. 2) A】 Search for Pretty Integers的更多相关文章

  1. 【Codeforces Round #440 (Div. 2) C】 Maximum splitting

    [链接] 我是链接,点我呀:) [题意] 在这里输入题意 [题解] 肯定用尽量多的4最好. 然后对4取模的结果 为0,1,2,3分类讨论即可 [代码] #include <bits/stdc++ ...

  2. 【Codeforces Round #440 (Div. 2) B】Maximum of Maximums of Minimums

    [链接] 我是链接,点我呀:) [题意] 在这里输入题意 [题解] k=1的时候就是最小值, k=2的时候,暴力枚举分割点. k=3的时候,最大值肯定能被"独立出来",则直接输出最 ...

  3. 【Codeforces Round #432 (Div. 1) B】Arpa and a list of numbers

    [链接]h在这里写链接 [题意] 定义bad list是一个非空的.最大公约数为1的序列.给定一个序列,有两种操作:花费x将一个元素删除.花费y将一个元素加1,问你将这个序列变为good list所需 ...

  4. 【Codeforces Round #420 (Div. 2) C】Okabe and Boxes

    [题目链接]:http://codeforces.com/contest/821/problem/C [题意] 给你2*n个操作; 包括把1..n中的某一个数压入栈顶,以及把栈顶元素弹出; 保证压入和 ...

  5. 【Codeforces Round #420 (Div. 2) B】Okabe and Banana Trees

    [题目链接]:http://codeforces.com/contest/821/problem/B [题意] 当(x,y)这个坐标中,x和y都为整数的时候; 这个坐标上会有x+y根香蕉; 然后给你一 ...

  6. 【Codeforces Round #420 (Div. 2) A】Okabe and Future Gadget Laboratory

    [题目链接]:http://codeforces.com/contest/821/problem/A [题意] 给你一个n*n的数组; 然后问你,是不是每个位置(x,y); 都能找到一个同一行的元素q ...

  7. 【Codeforces Round #423 (Div. 2) C】String Reconstruction

    [Link]:http://codeforces.com/contest/828/problem/C [Description] 让你猜一个字符串原来是什么; 你知道这个字符串的n个子串; 且知道第i ...

  8. 【Codeforces Round #423 (Div. 2) B】Black Square

    [Link]:http://codeforces.com/contest/828/problem/B [Description] 给你一个n*m的格子; 里面包含B和W两种颜色的格子; 让你在这个格子 ...

  9. 【Codeforces Round #423 (Div. 2) A】Restaurant Tables

    [Link]:http://codeforces.com/contest/828/problem/A [Description] 有n个组按照时间顺序来餐馆; 每个组由一个人或两个人组成; 每当有一个 ...

随机推荐

  1. Cisco PIX防火墙PPPoE拨号配置视频教学

    Cisco PIX防火墙PPPoE拨号配置视频教学   本文出自 "李晨光原创技术博客" 博客,请务必保留此出处http://chenguang.blog.51cto.com/35 ...

  2. C/C++(基础-常量,类型转换)

    字符 char ascII码表 #include<stdio.h> int main() { unsigned char ch; for(ch = 0;ch < 128;ch++) ...

  3. Python 3 下载安装和环境搭建

    Python3 下载 由于博主使用的平台是Windows10,以下方法仅限win10系统 Python 官网:https://www.python.org/ 找到跟系统相应的版本瞎子: Python ...

  4. HDU 2191 悼念512汶川大地震

    悼念512汶川大地震遇难同胞——珍惜现在,感恩生活 Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Jav ...

  5. 01-Jvm 内存区域复习笔记

    Java内存区域          1.程序计数器(Program Counter Register)         在虚拟机中一块较小的内存空间.它的作用能够看做是当前线程所运行的字节码的行号指示 ...

  6. WINDOWS 安装 M2Crypto for Python2.7

    WINDOWS 安装 M2Crypto for Python2.7运行环境 WIN8.1 + Python2.7 + VS2008(Microsoft Visual C++ 9.0) VS2008 可 ...

  7. vim-大小写装换

    以下内容参考自 http://blog.csdn.net/yangzhongxuan/article/details/8484167 自己验证了效果 命令一:单个字符转换(光标所在位置的字母进行转换) ...

  8. redmine-bug 问题修改流程

    1.当我们接受到测试发过来的bug以后,首先就是针对描述,弄清出问题,如果不能重现或者是对问题不清楚,那么可以去找提出者确认 注意:有时候一个问题可能是经过几次重开或者追加提出的,这时候你一定要从头到 ...

  9. Zabbix监控,Mysql,Nginx,PHP-FTPM

    一 Zabbix监控Mysql 监控Mysql,Zabbix提供了一个监控模板,所有可以直接使用.或者使用Percona提供的监控模板. 1. 使用自带监控模板 1.1.1 编写监控模板 #!/bin ...

  10. POJ 1082 Calendar Game

    Adam and Eve enter this year's ACM International Collegiate Programming Contest. Last night, they pl ...