杂类
文章平均质量分 75
1A_coder
Just for fun!
展开
-
C. Vanya and Scales (进制转换)
C. Vanya and Scalestime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputVanya has a scales for weighing loads an原创 2016-01-07 10:06:37 · 463 阅读 · 0 评论 -
ACM竞赛要掌握的知识
路径问题 0/1边权最短路径 BFS 非负边权最短路径(Dijkstra) 可以用Dijkstra解决问题的特征负边权最短路径Bellman-FordBellman-Fo转载 2014-09-26 20:11:57 · 705 阅读 · 0 评论 -
hdu 4768 Flyer(二分查找)
FlyerTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1537 Accepted Submission(s): 552Problem DescriptionThe new semester begi原创 2014-08-09 12:24:29 · 934 阅读 · 0 评论 -
hdu 4925 Apple Tree
Apple TreeTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 262144/262144 K (Java/Others)Total Submission(s): 244 Accepted Submission(s): 173Problem DescriptionI’ve bought an原创 2014-08-08 09:21:03 · 861 阅读 · 0 评论 -
codeforce B. Road Construction
http://codeforces.com/problemset/problem/330/B B. Road Constructiontime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard output原创 2013-11-18 19:58:41 · 917 阅读 · 0 评论 -
hdu 2504 又见GCD
http://acm.hdu.edu.cn/showproblem.php?pid=2504 Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 8249 Accepted Submission(s): 3414原创 2013-11-16 12:24:24 · 950 阅读 · 0 评论 -
hdu 4907 Task schedule(二分查找)
Task scheduleTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 714 Accepted Submission(s): 347Problem Description有一台机器,并且给你这台机器原创 2014-08-05 18:21:01 · 503 阅读 · 0 评论 -
hdu 1215 七夕节
http://acm.hdu.edu.cn/showproblem.php?pid=1215七夕节hdu1215原创 2013-12-06 21:21:49 · 675 阅读 · 0 评论 -
poj 1089 Intervals
poj 1089 Intervals贪心DescriptionThere is given the series of n closed intervals [ai; bi], where i=1,2,...,n. The sum of those intervals may be represented as a sum of closed pairwise non−intersecting intervals. The task is to find such representation wit原创 2013-12-10 20:40:34 · 1310 阅读 · 0 评论 -
poj 3087 Shuffle'm Up (模拟搜索)
Shuffle'm UpTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 5953 Accepted: 2796DescriptionA common pastime for poker players at a poker table is to sh原创 2014-10-05 14:30:04 · 780 阅读 · 0 评论 -
zzuli 1150: 组合三位数之一(函数专题)
1150: 组合三位数之一(函数专题)时间限制: 1 Sec 内存限制: 128 MB提交: 106 解决: 68[提交][状态][讨论版]题目描述把1、2、3、4、5、6、7、8、9组合成3个3位数,要求每个数字仅使用一次,使每个3位数均为完全平方数。按从小到大的顺序输出这三个三位数。输入无输出按从小到大的顺序输出这三个三位数,由空格隔开。输出占一行。样例输...原创 2013-12-28 11:03:53 · 2882 阅读 · 0 评论 -
在 ACM竞赛中,为什么美国的公认的计算机名校,如 MIT,斯坦福、加州伯克利、卡内基梅隆,表现不如中国和俄罗斯的高校?
知乎上看到的比较好的解释:是这样,我在美国念书,去年的时候我参加regional比赛时我们赛区有些非常出名的计算机学校,但是我们很轻松的就把他们秒杀了,还差一点进final。其实这个问题说起来很好解释,我上大学之后明显编码水平下降了, 因为在北美念书你会发现主要做的都是一些开创性的工作,整体教育体系是不赞成学生做大量重复性工作的。在美国主要是培养的你的一种学习和创新的能力,也就是为什么美国转载 2014-11-13 21:09:06 · 1149 阅读 · 0 评论 -
zzuli 1732: 五子棋 (搜索+模拟)
1732: 五子棋Time Limit: 1 Sec Memory Limit: 128 MBSubmit: 234 Solved: 4SubmitStatusWeb BoardDescriptionInputOutputSample Input210 10.......................1.....原创 2015-04-19 22:50:52 · 1966 阅读 · 0 评论 -
背包9讲
P01: 01背包问题 题目 有N件物品和一个容量为V的背包。第i件物品的费用是c[i],价值是w[i]。求解将哪些物品装入背包可使这些物品的费用总和不超过背包容量,且价值总和最大。 基本思路 这是最基础的背包问题,特点是:每种物品仅有一件,可以选择放或不放。 用子问题定义状态:即f[i][v]表示前i件物品恰放入一个容量为v的背包可以获得的最大价值。则其状态转移方程便转载 2015-01-31 14:02:14 · 471 阅读 · 0 评论 -
二分查找小结
先看二分查找的一般写法#include#include#include#include#include#includeusing namespace std;#define N 100005#define ll __int64int n,a[N];int findd(int x) { int l=0,r=n-1; while(l<=r) {原创 2014-12-19 12:55:24 · 565 阅读 · 0 评论 -
UESTC 1171 Ants Run!
http://acm.uestc.edu.cn/problem.php?pid=1171 Ants Run!Time Limit: 1000 ms Memory Limit: 65535 kB DescriptionProfessor Yang likes to play with ants when he is fre原创 2013-12-18 16:23:26 · 1128 阅读 · 0 评论 -
POJ 计算几何入门题目推荐
之所以推荐计算几何题,是因为,本人感觉ACM各种算法中计算几何算是比较实际的算法.计算几何题的特点与做题要领:1.大部分不会很难,少部分题目思路很巧妙2.做计算几何题目,模板很重要,模板必须高度可靠。3.要注意代码的组织,因为计算几何的题目很容易上两百行代码,里面大部分是模板。如果代码一片混乱,那么会严重影响做题正确率。4.注意精度控制。5.能用整数的地方尽量用整数,要想到转载 2014-12-03 10:17:28 · 520 阅读 · 0 评论 -
hdu 4445 Crazy Tank (暴力枚举)
Crazy TankTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 4562 Accepted Submission(s): 902Problem DescriptionCrazy Tank was a原创 2014-10-20 17:36:25 · 1221 阅读 · 0 评论 -
hdu 4442 Physical Examination (排序)
Physical ExaminationTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 5813 Accepted Submission(s): 1625Problem DescriptionWANGP原创 2014-10-20 16:47:12 · 632 阅读 · 0 评论 -
hdu 3683 Gomoku (模拟、搜索)
GomokuTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1319 Accepted Submission(s): 328Problem DescriptionYou are probably not原创 2014-10-13 11:04:12 · 1044 阅读 · 0 评论 -
hdu 1201 18岁生日
Problem - 1201 http://acm.hdu.edu.cn/showproblem.php?pid=1201Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 15476 Accepted Submission(原创 2013-11-14 10:30:21 · 714 阅读 · 0 评论 -
hdu 4930 Fighting the Landlords (模拟)
Fighting the LandlordsTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 262144/262144 K (Java/Others)Total Submission(s): 160 Accepted Submission(s): 52Problem DescriptionFigh原创 2014-08-07 18:57:58 · 1028 阅读 · 0 评论 -
hdu 2141 Can you find it?
Can you find it?Time Limit: 10000/3000 MS (Java/Others) Memory Limit: 32768/10000 K (Java/Others)Total Submission(s): 9863 Accepted Submission(s): 2587Problem DescriptionGive you原创 2014-04-28 21:54:21 · 686 阅读 · 0 评论 -
快速幂取模算法模板
int powmod(int a,int b,int c){ int s=1; a%=c; while(b) { if(b%2) s=(s*a)%c; b/=2; a=(a*a)%c; } return s;}原创 2014-05-09 20:31:09 · 592 阅读 · 0 评论 -
hdu 3067 小t的游戏
小t的游戏Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 235 Accepted Submission(s): 130Problem Description小t有点神经质,喜欢发明一些稀奇古怪的游戏,原创 2014-03-16 19:13:20 · 800 阅读 · 0 评论 -
poj 水题
此类的题目都是刚学C语言不久刚接触ACM的时候做的。。完全没算法。。最多有点小技巧。。题型很杂。。评述的话主要是自己以后找起题来方便。。大牛们忽略就好。。1000 纯属适应题1003 做的时候花了很久,现在看好像也不难1004 适应题,求下平均就行1005 要读懂题就行1007 逆序数,discuss方法1046 全部暴搜一遍。。1118转载 2013-12-24 23:11:23 · 685 阅读 · 0 评论 -
UESTC 1899 P酱的冒险旅途
http://acm.uestc.edu.cn/problem.php?pid=1899 P酱的冒险旅途Time Limit: 1000 ms Memory Limit: 65535 kB Solved: 88 Tried: 595 SubmitStatusBest SolutionBack原创 2013-12-17 15:11:55 · 1400 阅读 · 0 评论 -
hdu 1785 You Are All Excellent
http://acm.hdu.edu.cn/showproblem.php?pid=1785You Are All ExcellentTime Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2508 Accepted Subm原创 2013-12-30 14:01:21 · 717 阅读 · 0 评论 -
UESTC 1904 树上的鸟儿
http://acm.uestc.edu.cn/problem.php?pid=1904&cid=229 树上的鸟儿Time Limit: 1000 ms Memory Limit: 65535 kB Solved: 43 Tried: 188 SubmitStatusBest SolutionBack原创 2013-12-16 22:37:55 · 1053 阅读 · 0 评论 -
hdu 4493 Tutor
TutorTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65535/65535 K (Java/Others)Total Submission(s): 1981 Accepted Submission(s): 552Problem DescriptionLilin was a student o原创 2014-07-16 11:27:57 · 1108 阅读 · 0 评论 -
NYOJ 303 序号互换
序号互换时间限制:1000 ms | 内存限制:65535 KB难度:2描述Dr.Kong设计了一个聪明的机器人卡多,卡多会对电子表格中的单元格坐标快速计算出来。单元格的行坐标是由数字编号的数字序号,而列坐标使用字母序号。观察字母序号,发现第1列到第26列的字母序号分别为A,B,…,Z,接着,第27列序号为AA,第28列为AB,依此类推。若给Dr原创 2014-04-26 22:07:50 · 818 阅读 · 0 评论 -
汉诺塔系列问题: 汉诺塔II、汉诺塔III、汉诺塔IV、汉诺塔V、汉诺塔VI
汉诺塔汉诺塔II hdu1207:先说汉若塔I(经典汉若塔问题),有三塔,A塔从小到大从上至下放有N个盘子,现在要搬到目标C上,规则小的必需放在大的上面,每次搬一个,求最小步数。这个问题简单,DP:a[n]=a[n-1]+1+a[n-1],先把上面的n-1个放在B上,把最大的放在目标C上,再把N-1个放回到C上即可。网上的一种最优解法如下:(1)将x(1#inc原创 2014-07-20 17:59:26 · 3480 阅读 · 0 评论 -
hdu 1556 Color the ball&&hdu 4883 TIANKENG’s restaurant
http://acm.hdu.edu.cn/showproblem.php?pid=1556Color the ballTime Limit: 9000/3000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 6793 Accepted Submission(s)原创 2014-01-01 11:58:01 · 1065 阅读 · 0 评论 -
poj 1068 Parencodings(模拟)
ParencodingsTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 18825 Accepted: 11348DescriptionLet S = s1 s2...s2n be a well-formed string of parentheses原创 2014-04-08 14:26:37 · 751 阅读 · 0 评论 -
poj 1753 Flip Game
Flip GameTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 28190 Accepted: 12221DescriptionFlip game is played on a rectangular 4x4 field with two-sided pie原创 2014-03-25 20:34:18 · 818 阅读 · 0 评论 -
poj 1018 Communication System (枚举+贪心)
http://poj.org/problem?id=1018Communication SystemTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 21648 Accepted: 7697DescriptionWe have received an ord转载 2013-12-16 17:46:28 · 620 阅读 · 0 评论 -
hdu 3833 YY's new problem(hash表)
YY's new problemTime Limit: 12000/4000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 3501 Accepted Submission(s): 984Problem DescriptionGiven a permutation P of 1 to N, YY wants to know whether there exists suc原创 2014-03-11 20:39:44 · 877 阅读 · 0 评论 -
UESTC 1903 铁路
铁路Time Limit: 1000 ms Memory Limit: 65535 kB Description很久很久以前,E国遭遇了一次巨大的冲击。E国的铁路运输网已经完全崩溃。但是伟大的列车托夫出现了,他领导着E国人重新开始修铁路。为了生产资料的运输,我们希望任意的两个城市都能够经由铁路直接或间接连通。但是E国的城市修原创 2013-12-17 18:53:31 · 1554 阅读 · 0 评论 -
UESTC 1900 倒推数组 (找规律)
http://acm.uestc.edu.cn/problem.php?pid=1900 倒推数组Time Limit: 1000 ms Memory Limit: 65535 kB Description我们给出一个奇怪的公式:其中min(x,y) 表示x,y中的较小值。如果你对求转载 2013-12-19 19:53:00 · 993 阅读 · 0 评论 -
zoj 3710 Friends
http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=5013 Time Limit: 2 Seconds Memory Limit: 65536 KBAlice lives in the country where people like to make friends. The friendship is原创 2013-11-18 10:21:05 · 1033 阅读 · 0 评论