题解

前六个排序然后比较…

代码

#include <cstdio>
#include <queue>
#include <cstring>
#include <iostream>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <map>
#include <string>
#include <set>
#include <ctime>
#include <cmath>
#include <cctype>
using namespace std;
#define MAX 100000
#define LL long long
int cas=1,T;
int a[MAX];
int b[MAX];
int main()
{
    while(scanf("%d%d%d%d%d%d%d",&a[0],&a[1],&a[2],&a[3],&a[4],&a[5],&a[6])!=EOF)
    {
       for (int i = 0;i<7;i++)
           scanf("%d",&b[i]);
       sort(a,a+6);
       sort(b,b+6);
       int flag = 1;
       if (a[6]==b[6])
           flag=1;
       else
           flag=0;
       for (int i = 0;i<6;i++)
       {
           if (a[i]==b[i])
               continue;
           else
           {
               flag = 0;
               break;
           }
       }

       if (flag)
           printf("yes\n");
       else
           printf("no\n");
       memset(a,0,sizeof(a));
       memset(b,0,sizeof(b));
    }
    return 0;
}

题目

七龙珠

Time Limit: 1 Sec Memory Limit: 128 MB

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