#include <iostream>
#include <algorithm>
#include <cmath>
#define MAXN 1000
#define M_15 15
using namespace std; int _b[M_15];
struct node
{
int tot;
int v;
int d[];
node()
{
v = ;
tot = ;
}
}; void fun_3();
node _[MAXN];
int fun_2(int sum);
int fun_1(int d,int k);
int n;
int d;
int main()
{
//freopen("acm.acm","r",stdin); int k;
int i;
int j;
int p;
int tem;
cin>>n;
cin>>d;
cin>>k; for(i = ; i < n; ++ i)
{
cin>>_[i].tot;
for(j = ; j < _[i].tot; ++ j)
{
//cin>>_[i].d[j];
cin>>tem;
_[i].d[tem-] = ;
}
}
fun_3();
cout<<fun_1(d,k)<<endl;
} int fun_1(int d,int k)
{
int i;
int j;
int sum;
int max = -;
for(i = ; i < k; ++ i)
{
_b[i] = ;
}
sort(_b,_b+d);
sum = ;
int tem = ;
for(i = d-; i >= ; -- i)
{
sum += _b[i]*pow((double),tem);
++ tem;
}
// cout<<sum<<endl;
if((tem = fun_2(sum) ) > max)
{
max = tem;
}
// cout<<tem<<endl;
while(next_permutation(_b,_b+d))
{
sum = ;
int tem = ;
for(i = d-; i >= ; -- i)
{
sum += _b[i]*pow((double),tem);
++ tem;
}
// cout<<sum<<endl;
tem = fun_2(sum);
// cout<<tem<<endl;
if(tem > max)
{
max = tem;
}
}
return max; } int fun_2(int sum)
{
int i;
int j;
int t = ;
for(i = ; i < n; ++ i)
{
if(sum == (sum|_[i].v) )
{
++ t;
}
// cout<<sum<<"_"<<_[i].v<<endl;
}
// cout<<"000000000000000000000————————"<<t<<endl;
return t;
} void fun_3()
{
int tem = ;
int i;
int j;
for(i = ; i < n; ++ i)
{
tem = ;
for(j = d-; j >= ; -- j)
{
_[i].v += _[i].d[j]*pow((double),tem);
++ tem;
}
// cout<<_[i].v<<endl;
// cout<<" d "<<d<<endl;
}
}

POJ 2453的更多相关文章

  1. [POJ] 2453 An Easy Problem [位运算]

    An Easy Problem   Description As we known, data stored in the computers is in binary form. The probl ...

  2. [poj 2453] An Easy Problem

    An Easy Problem Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 8371   Accepted: 5009 D ...

  3. 模板:统计1~n内x的个数

    http://noi.openjudge.cn/ch0105/40/ 40:数1的个数-拓展变形 查看 提交 统计 提问 总时间限制:  1000ms 内存限制:  65536kB 描述 给定一个十进 ...

  4. POJ 3370. Halloween treats 抽屉原理 / 鸽巢原理

    Halloween treats Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 7644   Accepted: 2798 ...

  5. POJ 2356. Find a multiple 抽屉原理 / 鸽巢原理

    Find a multiple Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 7192   Accepted: 3138   ...

  6. POJ 2965. The Pilots Brothers' refrigerator 枚举or爆搜or分治

    The Pilots Brothers' refrigerator Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 22286 ...

  7. POJ 1753. Flip Game 枚举or爆搜+位压缩,或者高斯消元法

    Flip Game Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 37427   Accepted: 16288 Descr ...

  8. POJ 3254. Corn Fields 状态压缩DP (入门级)

    Corn Fields Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 9806   Accepted: 5185 Descr ...

  9. POJ 2739. Sum of Consecutive Prime Numbers

    Sum of Consecutive Prime Numbers Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 20050 ...

随机推荐

  1. 在table中tr的display:block在firefox下显示布局错乱问题

    [转自:] http://blog.csdn.net/sd2131512/article/details/4720345 按照常理,对于某一单元行需要显示时,使用:display:block属性,不需 ...

  2. (14)Why some people find exercise harder than others

    https://www.ted.com/talks/emily_balcetis_why_some_people_find_exercise_harder_than_others/transcript ...

  3. Codeforces Round #548 (Div. 2) D 期望dp + 莫比乌斯反演

    https://codeforces.com/contest/1139/problem/D 题意 每次从1,m中选一个数加入队列,假如队列的gcd==1停止,问队列长度的期望 题解 概率正着推,期望反 ...

  4. TCP/IP协议(3):数据链路层

    OSI数据链路层上的协议有Ethernet/IEEE802.3/IEEE802.4/IEEE802.5. ARP.RARP等. 1.Ethernet(以太网) 链路层支持很多协议,比如Ethernet ...

  5. jquery的bind()和trigger()

    本文主要介绍JQuery的trigger()和bind()方法. 1.   $(selector).bind(event,data,function)方法为被选元素添加一个或多个事件处理程序,并规定事 ...

  6. nginx调优操作之nginx隐藏其版本号

    1.nginx下载 下载网址:nginx.org 2.解压nginx [root@iZwz9cl4i8oy1reej7o8pmZ soft]# ls nginx-.tar.gz [root@iZwz9 ...

  7. C和C++中的volatile、内存屏障和CPU缓存一致性协议MESI

    目录 1. 前言2 2. 结论2 3. volatile应用场景3 4. 内存屏障(Memory Barrier)4 5. setjmp和longjmp4 1) 结果1(非优化编译:g++ -g -o ...

  8. DC画线

    CClientDC hdc(this);//获取DC CPen pen(PS_SOLID,4,RGB(255,0,0));//创建一支红笔 CPen * pOldPen=hdc.SelectObjec ...

  9. 深入浅出javascript(二)函数和this对象

    一.函数对象的属性和方法 函数是一种数据类型,也是对象,这一点很明确.因此,函数对象也可以添加属性和方法,但是这里的属性和方法是静态的,之所以这样说,就是为了区别构造函数. 示例如下: ①创建一个空的 ...

  10. 队列<一>

    这里用的递归法,采用两种版本,一种是C语言,一种是C++:但是,用C语言没有“引用”,所以采用的是指向指针的指针:而C++具备“引用”,所以直接用&引用,简洁: 先看C++的代码: BiTre ...