Codeforces 469A I Wanna Be the Guy
来源:互联网 发布:win10软件很模糊 编辑:程序博客网 时间:2024/06/05 08:35
题意:
给你n,p个1~n之间的数,q个1~n之间的数,问你1~n之间的数是否都出现过。
思路:
对输入得数标记下,然后枚举1~n之间的数看是否有没有标记过的。
#include<cstdio>#include<cstring>const int MAX=105;bool vis[MAX];int main(){int n,p,q,a;scanf("%d",&n);memset(vis,false,sizeof(vis));scanf("%d",&p);for(int i=1;i<=p;i++){scanf("%d",&a);vis[a]=true;}scanf("%d",&q);for(int i=1;i<=q;i++){scanf("%d",&a);vis[a]=true;}bool flag=true;for(int i=1;i<=n;i++){if(vis[i]==false){flag=false;break;}}if(flag) printf("I become the guy.\n");else printf("Oh, my keyboard!\n");return 0;}
0 0
- 【CodeForces】A. I Wanna Be the Guy
- codeforces-#469A. I Wanna Be the Guy(模拟)
- CodeForces 469A. I Wanna Be the Guy(数学)
- Codeforces 469A I Wanna Be the Guy(水题)
- Codeforces 469A I Wanna Be the Guy
- 469A - I Wanna Be the Guy
- Codeforces I Wanna Be the Guy
- A. I Wanna Be the Guy
- CF 469A I Wanna Be the Guy
- CodeForces 469A. I Wanna Be the Guy set简单应用
- I wanna be a DBA
- I don't wanna be in the dark!
- binshenOJ 1215-I Wanna Be A Palindrome (YY)
- kuangbinOJ G I Wanna Be A Palindrome (贪心)
- I wanna a girl
- I Am A Tough Guy
- Make Anonymous be the lucky guy
- I'm the new guy here
- CSS content、padding、border、margin属性
- 细谈0、false、null
- Android UI学习篇:ListView
- w3c js笔记
- HDU 2563 统计问题
- Codeforces 469A I Wanna Be the Guy
- hdoj 1052 Tian Ji -- The Horse Racing
- Learning Deep Features for Discriminative Localization论文笔记以及Caffe实现
- 虚拟机安装
- Android静默安装实现方案,仿360手机助手秒装和智能安装功能
- 增长xx%带来什么信息?
- POJ 1947 Rebuilding Roads (树形dp + 01背包)
- 实验项目3-4:一元多项式的乘法与加法运算
- (学习笔记3)STM32F429库函数之I2C读取EEPROM