题意: 有n个数,问有多少方案满足取几个数的异或值>=m; 思路: 背包思想,每次就是取或不取,然后输出>=m的方案就好了. #include <bits/stdc++.h> using namespace std; typedef long long LL; const int N=2097150+10; LL dp[2][N]; int a[50]; int n,m; int main() { int cas=1; int T; scanf("%d",&am…
Corn Fields 2015-11-25 13:42:33 Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 10658 Accepted: 5602 Description Farmer John has purchased a lush new rectangular pasture composed of M by N (1 ≤ M ≤ 12; 1 ≤ N ≤ 12) square parcels. He wa…
Buy the souvenirs Time Limit: 10000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1886 Accepted Submission(s): 699 Problem Description When the winter holiday comes, a lot of people will have a trip. Genera…
//g[i,j]表示f[i,j]取最大值的方案数目 //体积最多是j 全部为0,v>=0 //体积恰好为j f[0][0]=0,f[i]=无穷,v>=0 //体积至少是j f[0][0]=0,f[i]=无穷,体积为负数时于0取大 #include <cstring> #include <iostream> using namespace std; , mod = 1e9 + ; int n, m; int f[N], g[N]; int main() { cin >…
我们定义第一代hiho字符串是"hiho". 第N代hiho字符串是由第N-1代hiho字符串变化得到,规则是: h -> hio i -> hi o -> ho 例如第二代hiho字符串是: hiohihioho 第三代是: hiohihohiohihiohihohioho 给定N和K,请你计算第N代hiho字符串中的第K个字符是什么. Input 第一行包含一个整数T,代表测试数据的组数. (1 ≤ T ≤ 10) 以下T行每行包含两个整数N和K. 对于50%的数…