Naive and Silly Muggles Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 152    Accepted Submission(s): 107 Problem Description Three wizards are doing a experiment. To avoid from bothering, a s…
EBCDIC Time Limit: 2000/2000 MS (Java/Others)    Memory Limit: 102400/102400 K (Java/Others)Total Submission(s): 160    Accepted Submission(s): 81 Problem Description A mad scientist found an ancient message from an obsolete IBN System/360 mainframe.…
Naive and Silly Muggles Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 24    Accepted Submission(s): 17 Problem Description Three wizards are doing a experiment. To avoid from bothering, a spec…
Naive and Silly Muggles Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 228 Accepted Submission(s): 163 Problem Description Three wizards are doing a experiment. To avoid from bothering, a special…
题目传送门 /* 题意:给三个点求它们的外接圆,判断一个点是否在园内 计算几何:我用重心当圆心竟然AC了,数据真水:) 正解以后补充,http://www.cnblogs.com/kuangbin/archive/2013/09/11/3315055.html */ #include <cstdio> #include <iostream> #include <algorithm> #include <cstring> #include <string…
Problem Description Three wizards are doing a experiment. To avoid from bothering, a special magic is set around them. The magic forms a circle, which covers those three wizards, in other words, all of them are inside or on the border of the circle.…
Naive and Silly Muggles Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 137    Accepted Submission(s): 94 Problem Description Three wizards are doing a experiment. To avoid from bothering, a spe…
Naive and Silly Muggles Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 452    Accepted Submission(s): 307 Problem Description Three wizards are doing a experiment. To avoid from bothering, a sp…
Naive and Silly Muggles Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 61    Accepted Submission(s): 39 Problem Description Three wizards are doing a experiment. To avoid from bothering, a spe…
Description Three wizards are doing a experiment. To avoid from bothering, a special magic is set around them. The magic forms a circle, which covers those three wizards, in other words, all of them are inside or on the border of the circle. And due…
p.MsoNormal { margin: 0pt; margin-bottom: .0001pt; text-align: justify; font-family: Calibri; font-size: 10.5000pt } h1 { margin-top: 5.0000pt; margin-bottom: 5.0000pt; text-align: center; font-family: 宋体; color: rgb(26,92,200); font-weight: bold; fo…
2018 HDU多校第四场赛后补题 自己学校出的毒瘤场..吃枣药丸 hdu中的题号是6332 - 6343. K. Expression in Memories 题意: 判断一个简化版的算术表达式是否合法. 题解: 注意细节即可. 代码: #include <bits/stdc++.h> using namespace std; int n; char s[505]; int main () { int T; cin>>T; for ( ; T; --T) { scanf(&quo…
2018 HDU多校第三场赛后补题 从易到难来写吧,其中题意有些直接摘了Claris的,数据范围是就不标了. 如果需要可以去hdu题库里找.题号是6319 - 6331. L. Visual Cube 题意: 在画布上画一个三维立方体. 题解: 模拟即可. 代码: #include <bits/stdc++.h> using namespace std; int a, b, c, R, C; char g[505][505]; int main () { int T; cin >>…
HDU 1284 钱币兑换问题(全然背包:入门题) http://acm.hdu.edu.cn/showproblem.php?pid=1284 题意: 在一个国家仅有1分,2分.3分硬币,将钱N (N<32768) 兑换成硬币有非常多种兑法. 请你编程序计算出共同拥有多少种兑法. 分析:基础的全然背包问题. 本题限制条件是: 金钱总数<=N. 本题目标条件是: 求构造方法数目. 令dp[i][j]==x 表示用前i种硬币构造j 美分共同拥有x种方法. 初始化:  dp为全0且dp[0][0]…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4720 题目大意:给你四个点,用前三个点绘制一个最小的圆,而这三个点必须在圆上或者在圆内,判断最一个点如果在圆外则是安全的,否则是危险的. 解题思路:我是先借用了别人的模板求三个点组成的最小的圆的圆心以及半径,就列出了圆的标准方程,将第四个点代入其中,则即可以判断此点是否在圆上还是圆外. AC代码: #include <iostream> #include <cstdio> #inclu…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4720 解题报告:给出一个三角形的三个顶点坐标,要求用一个最小的圆将这个三个点都包含在内,另外输入一个点,问这个点是否在这个圆的圆外,如果在圆外,输出Safe,否则输出Danger. 现在的主要目的其实就是求这个最小的三角形的圆心坐标,很显然,当这个三角形是锐角三角形的时候,这个最小的圆就是这个锐角三角型的外接圆,否则就是以这个三角形最长的那条边的中点为圆心,以这条边的一半为半径的圆. #includ…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5038 解题报告:就是输入n个数w,定义s = 10000 - (100 - w)^2,问s出现频率最高的是哪些,当所有的不同的s出现频率相同时,输出Bad Mushroom,当s只有一种时,直接输出. #include<cstdio> #include<cstring> #include<iostream> #include<algorithm> using n…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4720 先两两点之间枚举,如果不能找的最小的圆,那么求外心即可.. //STATUS:C++_AC_0MS_292KB #include <functional> #include <algorithm> #include <iostream> //#include <ext/rope> #include <fstream> #include <…
题目地址:HDU 4901 这题没想到最后竟然可以做出来.. .. 这题用了两次DP,先从前往后求一次异或的.再从后往前求一次与运算的. 各自是 1:求异或的时候,定义二维数组huo[1000][1024],前者指第几位,后者是哈希的思想.若huo[x][y]=2则表示最右边的数为第x位时,异或值为y的出现了两次,须要再定义一个hash数组.来保存前面出现的全部情况.再找有多少位的时候,用hash数组中出现的全部的值与当前的第x位的数字进行异或. 2:求与的时候,定义二维数组yu[1000][1…
链接 一直理解的最小覆盖圆就是外接圆..原来还要分钝角和锐角... 钝角的话就为最长边的中点,对于这题分别枚举一下外接圆以及中点的圆,判一下是不是在园外. #include <iostream> #include<cstdio> #include<cstring> #include<algorithm> #include<stdlib.h> #include<vector> #include<cmath> #include…
Stupid Tower Defense Time Limit: 12000/6000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others) Total Submission(s): 151    Accepted Submission(s): 32 Problem Description    FSF is addicted to a stupid tower defense game. The goal of towe…
http://acm.hdu.edu.cn/showproblem.php?pid=5063 题目大意: 题目意思还是比较简单.所以就不多少了.注意这句话,对解题有帮助. Type4: Q i query current value of a[i], this operator will have at most 50. 解题思路: 因为给定n和m都是100000,我们每一步都做具体的操作,时间将是O(n*m),肯定超时.最开始的时候 我怎么想都不知道怎么解决.以为是线段树.比赛完了以后,看了解…
http://acm.hdu.edu.cn/showproblem.php?pid=1285 #include <cstdio> #include <cstdlib> #include <cstring> #include <cmath> #include <algorithm> #include <assert.h> #define IOS ios::sync_with_stdio(false) using namespace st…
题意:求解01背包价值的第K优解. 分析: 基本思想是将每个状态都表示成有序队列,将状态转移方程中的max/min转化成有序队列的合并. 首先看01背包求最优解的状态转移方程:\[dp\left[ j \right] = \max \left\{ {dp\left[ j \right],dp\left[ {j - a\left[ i \right].w} \right] + a\left[ i \right].v} \right\}\] 如果要求第K优解,那么状态 dp[j] 就应该是一个大小为…
Higher Math Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2219    Accepted Submission(s): 1219 Problem Description You are building a house. You’d prefer if all the walls have a precise right…
Keywords Search Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others) Total Submission(s): 57353    Accepted Submission(s): 18820 Problem Description In the modern time, Search engine came into the life of everybody li…
http://acm.hdu.edu.cn/showproblem.php?pid=4280 题意:在最西边的点走到最东边的点最大容量. 思路:ISAP模板题,Dinic过不了. #include <cstdio> #include <algorithm> #include <iostream> #include <cstring> #include <string> #include <cmath> #include <que…
题意:给一棵树,每次给两个节点间的所有节点发放第k种东西,问最后每个节点拿到的最多的东西是哪种. 解法:解决树的路径上的修改查询问题一般用到的是树链剖分+线段树,以前不会写,后来学了一下树链剖分,感觉也不是很难,就是把整个数分成很多链,然后一条重链上的点在线段树中位置是连续的,这样使得更新和查询时更加便利. 这个题目中线段树应该维护的是种类,每次对u-v发放k时,可以让u处+k,v+1处-k,把这些都离线存起来,然后枚举1~n,分别把自己该做的操作都做了,然后统计的时候tree[1].type就…
参考iwtwiioi的模板写出来的.上午gty讲的并没有听懂,只好自己慢慢对着模板理解. 在HDU上为什么相同的程序提交有时T有时A!!! 奉上sth神犇的模板(不是这道题): var ch:char; q,g,num:array [0..500001] of longint; st:string; son:array [0..500001,'a'..'z'] of longint; ts:array [0..1000001] of char; l,s,t,n,i,j,m,k,ans,head,…
HDU 1029 题目大意:给定数字n(n <= 999999 且n为奇数 )以及n个数,找出至少出现(n+1)/2次的数 解题思路:n个数遍历过去,可以用一个map(也可以用数组)记录每个数出现的次数, 若次数一旦达到(n+1)/2,即输出a[i] 注意能出现(n+1)/2次数的最多只有一个 /* HDU 1029 *Ignatius and the Princess IV --- dp */ #include <cstdio> #include <cstring> #in…