本文主要是介绍【ZSTU4211 2015年12月浙理工校赛 B】【水题】七龙珠 排序判相同,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
4211: 七龙珠
Time Limit: 1 Sec Memory Limit: 128 MBSubmit: 786 Solved: 334
Description
话说孙壕请吃了青岛大虾后,一下子变穷了,就去找了个算命先生算算这辈子是有钱还是没钱。他在纸上写下“性命”两个字,问孙壕哪个字重要。
孙壕想了想说当然是命比较重要。
他摇摇头:“你,没钱”
“为什么?”
“有钱,任性。没钱,认命。”
孙壕问大师,我想要很多钱,还望大师指点。
大师:世间有七个珠子,只要集齐就可以实现你的愿望。
孙壕:哦,莫非大师说的是七龙珠?
大师:滚特么犊子!我说的是双色球!
现在摇出7个球,你选了7个球,如果全中,那么你就发财了。
什么?不懂双色球?那我简单介绍下吧。
先摇出6个红色球,红色球在1到33之间,各不相同,不过摇出的顺序可不一定先小后大的。再摇出1个蓝色球,蓝色球是1到16之间的。
当然假设你买的6个红色球也不一定有序的。
不过有一点肯定的,6个红色球不会重复的。
Input
多组测试数据,每组输入2行,第一行先输入6个红色球和1个蓝色球,为开奖号码。第2行同样7个球,为你买的号码。
Output
对于每组测试数据输出1行,如果全中,那么输出yes,否则输出no
Sample Input
1 3 4 6 7 33 16 1 3 4 6 33 7 16
Sample Output
yes
#include<stdio.h>
#include<iostream>
#include<string.h>
#include<string>
#include<ctype.h>
#include<math.h>
#include<set>
#include<map>
#include<vector>
#include<queue>
#include<bitset>
#include<algorithm>
#include<time.h>
using namespace std;
void fre(){freopen("c://test//input.in","r",stdin);freopen("c://test//output.out","w",stdout);}
#define MS(x,y) memset(x,y,sizeof(x))
#define MC(x,y) memcpy(x,y,sizeof(x))
#define MP(x,y) make_pair(x,y)
#define ls o<<1
#define rs o<<1|1
typedef long long LL;
typedef unsigned long long UL;
typedef unsigned int UI;
template <class T1,class T2>inline void gmax(T1 &a,T2 b){if(b>a)a=b;}
template <class T1,class T2>inline void gmin(T1 &a,T2 b){if(b<a)a=b;}
const int N=0,M=0,Z=1e9+7,ms63=0x3f3f3f3f;
int casenum,casei;
int a[7],b[7];
int main()
{while(~scanf("%d",&a[0])){for(int i=1;i<7;++i)scanf("%d",&a[i]); for(int i=0;i<7;++i)scanf("%d",&b[i]);sort(a,a+6);sort(b,b+6);bool flag=1;for(int i=0;i<7;++i)if(a[i]!=b[i])flag=0;puts(flag?"yes":"no");}return 0;
}
/*
【题意】
水题*/
这篇关于【ZSTU4211 2015年12月浙理工校赛 B】【水题】七龙珠 排序判相同的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!