Problem I. The Longest Sequence ofRectanglesDescriptionA rectangle is specified by a pair of coordinates (x1 , y1) and (x2 , y2)indicating its lower-left and upper-right corners (x1 <= x2 and y1 <= y2). Fora pair of rectangles, A = ((X_A1, Y_A1), (X_A2, Y_A2)) and B = ((X_B1, Y_B1),(X_B2, Y_B2
转载 2012-03-24 19:10:00
731阅读
2评论
打表博弈#include#include#include#includeusing namespace std;int main(){ int i,t,T,k,s,n; scanf("%d",&T); for(t=1;t<=T;t++){ scanf("int num=0; for
原创 2023-09-15 09:12:40
32阅读
数位dp+AC自动机#include #include #include #include typedef long long ll;using namespace std;ll l,r;char a[20],b[20];int aa[20];inchar
原创 2023-09-15 09:18:54
27阅读
把原来的数组相邻两数逐个求差构造新数组,这样若a[i]!=0,只需要更新a[i+k]即可,达到o(n^2)的复杂度#include #include #include #include #def
原创 2023-09-15 09:25:50
41阅读
Problem K. Alice's PianoDescriptionAlice has a piano which can plays nice music, but it's different from otherpianos. It has two rows of keys, and the method of playing it is also quitespecial. When Alice plays piano, she has to put her two hands on the leftsideof the two rows of keys respec
转载 2012-03-24 19:39:00
550阅读
2评论
bfs搜索转动平面相当于改变重力的方向#include #include #include #define N 110using namespace std;struct line{ int x0,y0,x];struct Point{ int x,y,dir;};bool vi
原创 2023-09-15 09:18:20
35阅读
询问区间的最长回文#include#include#include#include#includeusing namespace std;const int maxn=200100;int rad[maxn*2];char str[maxn],s[maxn*2];int q;iaxn];int mm[maxn],mo[maxn]
原创 2023-09-15 09:32:55
46阅读
Problem C. VaccineDescriptionOn Christmas Eve, 2029, the unidentified "Apocalypse Virus" spreads andplunges JA into a state of emergency in a chaos known as the "LostChristmas" incident. An international organization known as the GHQintervenes with martial law and restores order
转载 2012-03-25 13:30:00
153阅读
2评论
组合数学问题#include #include #include #include #define mod 20130303typedef long long ll;using namespace std;char s[1010];is[10];ll c[1010][10
原创 2023-09-15 09:22:01
44阅读
KMP+状态DP#include#include#include#includeusing namespace std;char q[1200000],p[1200000];int nex[1200000];void getnext(){ int len=strlen(q),i,j,k=0,l; nex[0]=-1;i=0;j=-1; while(i<len){ if
原创 2023-09-15 09:33:29
33阅读
Description给定一个正整数X,求一个最小的正整数N,使得N能被X整除。并且N有个性质:其各位数字都相同,比如1111,222222……Input有若干组测试数据,以EOF结束。对于每组测试数据只有一行,包含一个正整数X(0 Output每组测试数据输出一行,包含1个正整数N。如果不存在则输出"No Solution"。Sample Input74S
原创 2023-09-15 09:42:18
44阅读
Problem C. VaccineDescriptionOn Christmas Eve, 2029, the unidentified "Apocalypse Virus" spreads andplunges JA into a state of emergencristmas" incident. An in
原创 2023-09-15 09:43:03
44阅读
Problem K. Alice's PianoDescriptionAlice has a piano which can plays nice music, but it's different from otherpianos. It has two rows of keys, and the method of playing it is also quitespecial
原创 2023-09-15 09:43:37
58阅读
Problem I. The Longest Sequence ofRectanglesDescriptionA rectangle is specified by a pair of coordinates (x1 , y1) and (x2 , y2)indicating its lowir o
原创 2023-09-15 09:43:49
42阅读
诶,数学弱爆了..比赛时候没推出来组合数学里的母函数(x+x^2+……+x^n)^m的展开式中x^k的系数整理得x^m   *  (1-x^n)^m   *   (1-
原创 2023-09-15 10:05:46
34阅读
MABODXAccept:17 Submit:88Time Limit:4000MS Memory Limit:65536KBDescriptionThere is a country which has N city. Because The king spend littlemoney on the road ,so there is one and only one path from any cityto another city,every city has a apple tree.The apple in one citywhich has only one apple tree
转载 2012-02-23 21:56:00
45阅读
2评论
源向每个小孩连边,容量是该小孩的初始糖数; 每个小孩向汇连边,容量是糖的平均数; 每个小孩想相邻的格子各连一条边,容量是1. 把图建
原创 2023-09-15 09:46:32
49阅读
MABODX Accept:17   Submit:88Time Limit:4000MS   Memory Limit:65536KBDescriptionThere is a country which has N city. Because The king spend littl
原创 2023-09-15 10:04:03
39阅读
DescriptionAssume an integer sequence contains N elements whose value could only be one of {0, 1, -1}. There may exist a positive integer D which can make the sum between i-th element and (i+D)-th element be zero, where i is a certain integer between 1 and N-D. Your task is to find out the maximal D
转载 2012-02-18 17:32:00
41阅读
2评论
题目地址http://acm.bupt.edu.cn/onlinejudge/newoj/showProblem/show_problem.php?problem_id=170这个题用到信息论里的几个概念。信息量、熵(不会的百度一下)假币可轻可重,每枚硬币都可能是假币。故此问题共有2*n种情况,每种情况的概率为1/(2*n)。所以此问题的熵为log(2*n)/log2。实验最多可能出现三种结果 ,根据最大熵原理,这种实验在可能出现的各种事件具有相等的概率时,所提供的平均信息量最大,故实验提供的平均信息量不超过log3/log2。设最少需称k次,则这k次实验提供的总信息量不超过k * log3/
转载 2012-01-26 12:59:00
48阅读
2评论
  • 1
  • 2