A.Babs' Box Boutique 给定n个盒子,每个盒子都有长宽高(任意两个盒子长宽高不完全相同),现在选盒子的任意两面,要求x1 <= x2 && y1 <= y2,问最多能选多少盒子满足这需求. 直接dfs暴搞................ #include <cstdio> #include <cstring> #include <string> #include <iostream> #include <c…
A.Babs' Box Boutique 一道简单的dfs搜索题,需要两两比较,然后搜到底,得到最大值就行了.比赛时队友写的,我只负责debug..赛后自己写的.. #include<iostream> #include<cstdio> #include<algorithm> #include<cstring> #include<string> #include<cmath> #include<set> #include&…
这套题..除了几何的都出了 完全没时间学几何.杯具 A,B,J 水题不解释 C.Pen Counts 这题的话 写几个不等式限制边得范围就行了 然后枚举最小边 D.Maximum Random Walk 这题的话. 正解是一个n^3的dp dp[i][j][k] 表示第i步走到第j位置最右为k的概率 然后用滚动数组搞,非常简单. 但是还有一种n ^ 2的方法. 被我在比赛中试出来的. 大概是直接记录的第i步走到最右为j的概率 #include <iostream> #include <a…
题目大意:使用两个哈希表来解决哈希冲突的问题.假如现在有两个哈希表分别为:H1,H2 ,大小分别为:n1,n2:现有一数据X需要插入,其插入方法为: 1.计算index1 = X MOD N1,  若哈希表H1的index1位置没有保存数据,则直接将X保存到H1得index1:否则,若哈希表H1的index1位置已经保存有数据X1,则将原来已保存的数据X1进行缓存,然后将X插入H1的index1的位置. 2.将上一步缓存的X1插入到哈希表H2,首先计算index2=X1 MOD N2,若H2的i…
Regionals 2013 :: North America - Southeast USA It Takes a Village As a Sociologist, you are studying a certain kingdom. This kingdom has a capitol city, several villages, and roads between them all. Through your sociological studies, you have been a…
2015 UESTC Winter Training #6 Regionals 2010 >> North America - Rocky Mountain A - Parenthesis 给一个长度不多于1000的表达式,只包含小写字母,加法运算,省略乘号的乘法运算和括号,输出去掉多余括号的表达式 括号匹配可以使用栈操作,只有两种情况可以去掉这一对括号: 左括号的左边是左边界.加法符号.左括号,并且右括号右边是有右边界.加法符号.右括号 如果括号内没有加法运算(括号内的括号里,也就是下一级括…
MPI Maelstrom 总时间限制:  1000ms 内存限制:  65536kB 描述 BIT has recently taken delivery of their new supercomputer, a 32 processor Apollo Odyssey distributed shared memory machine with a hierarchical communication subsystem. Valentine McKee's research advisor…
目录 ICPC North Central NA Contest 2018 1. 题目分析 2. 题解 A.Pokegene B.Maximum Subarrays C.Rational Ratio D.Travel the Skies E. Euler's Number F. Lipschitz Constant G. Tima goes to Xentopia H. New Salaries I. Other Side J.Kaleidoscopic Palindromes ICPC Nor…
题意:建一个家庭树,找出有第d代子孙的名字,按照要求的第d代子孙的数从大到小输出三个人名,如果有一样大小子孙数的,就按字母序从小到大将同等大小的都输出,如果小于三个人的就全输出. 题目链接:http://poj.org/problem?id=2732 分析:数据量很小,直接建树,枚举暴力输出.我直接套模板用map建树的. 注意:1.每次测试数据时要清空map和vector!!! 2.注意输出要从大到小输出答案,如果答案有一样的按名字的字母序从小到大输出.答案用vector保存,vector排序:…
E 每过一秒,当前点会把它的值传递给所有相邻点,问t时刻该图的值 #include <iostream> #include <cstdio> #include <algorithm> #include <list> #include <map> #include <stack> #include <vector> #include <cstring> #include <sstream> #incl…