- 博客(227)
- 收藏
- 关注
原创 北京邮电大学 2018 北邮 互联网应用课程设计 大作业 DNS域名解析
每年一定要经历的大作业....肝了两天写出来. 先看看18年的作业要求吧, 每年都不一样 实现中文域名的解析,例如:主页.北邮.教育.中国(与 www.bupt.edu.cn 对应); 至少支持 4 个顶级域,至少实现三级域名的解析。程序需要实现的实体有:client、 至少 6 个 DNS server。 支持的 Resource Record 类型:A、MX、CNA...
2019-08-20 09:41:38
3152
3
原创 [kuangbin带你飞]专题二 搜索进阶 题解(康托展开、映射、迭代加深)
专题链接A:Eight经典的八数码问题,这题直接bfs是不行的,时限不够,主要是在每个状态判重的时候使用map,在这里的复杂度可以通过康托展开来达到查重O(1),那么!什么是康托展开呢?! 我觉得这个博客写的很好,总之康托展开用来看当前状态中在全排列中是第几个,可以把问题的全部状态不用map来表示 这题hdu是多组样例输入,poj则单组。 本来网上写做这题要有八境界,把代码写八遍
2017-12-01 15:22:49
510
原创 2015 ICPC 北京场E、F、G (计算几何)
E - Cats and Fish#include <iostream>#include <cstdio>#include <algorithm>using namespace std;const int N = 105;int c[N];int tmp[N];int main(){ int m, n, x; while(~scanf("%d %d %d", &m,
2017-11-29 12:55:55
568
原创 [待补完]CODE FESTIVAL 2017 Final (Parallel) A,B,C(搜索)
比赛地址A - AKIBAxjb写#include <iostream>#include <cstring>#include <cstdio>#include <cmath>#include <vector>#include <map>#include <algorithm>#include <queue>using namespace std;char in[100];int
2017-11-26 00:51:05
292
原创 Codeforces Round #444 (Div. 2) A、B、C
题目链接A:#include <iostream>#include <cstring>#include <cstdio>#include <cmath>#include <vector>#include <map>#include <algorithm>using namespace std;const int maxn = 110;char str[maxn];int main
2017-11-15 11:09:19
294
原创 2016China Final 二分 UVALive7900(D)
题目链接 很简单的二分答案,为什么去年会做不出来呢。。。。哎。。#include <iostream>#include <cstring>#include <cstdio>#include <cmath>#include <vector>#include <map>#include <algorithm>using namespace std;const int maxn = 3e
2017-11-14 16:08:20
233
原创 Educational Codeforces Round 31(ABCD):有向图求环长度/数据结构贪心
比赛地址 A. Book Reading time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output Recently Luba bought a very interesting book. She know
2017-11-02 19:49:20
604
原创 2017-2018 ACM-ICPC Nordic Collegiate Programming Contest (NCPC 2017) 部分题/平衡树/最小环/思路bfs
交题地址难度按照顺序递增J - Judging Moose 队友敲的#include #include using namespace std;int main(){ int l, r; while(~scanf("%d %d", &l, &r)){ if(l == r && l != 0){ printf("Even ");
2017-10-30 21:34:17
1398
原创 Codeforces Round #443 (Div. 2) A、B、C 位运算
A题目链接 A. Borya’s Diagnosis time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output It seems that Borya is seriously sick. He is g
2017-10-27 15:04:57
295
原创 noip 2010 关押罪犯 二分图
题目链接 题目描述 S 城现有两座监狱,一共关押着N 名罪犯,编号分别为1~N。他们之间的关系自然也极不和谐。很多罪犯之间甚至积怨已久,如果客观条件具备则随时可能爆发冲突。我们用“怨气值”(一个正整数值)来表示某两名罪犯之间的仇恨程度,怨气值越大,则这两名罪犯之间的积怨越多。如果两名怨气值为c 的罪犯被关押在同一监狱,他们俩之间会发生摩擦,并造成影响力为c 的冲突事件。 每年
2017-10-24 23:55:19
292
原创 CODE FESTIVAL 2017 qual B:C - 3 Steps 并查集判二分图、二分图性质
题目链接 题意:给一个连通的无向图,让我们往距离为三的两个不同的点添加一条边,问最终能够添加多少条边 比赛时做的没想法,官方题解讲得很清楚假设在ss和t之间存在一条长度为奇数的路径,也就是说对于某个奇数t之间存在一条长度为奇数的路径,也就是说对于某个奇数k,存在一个点的序列,存在一个点的序列s=v0,v1,...,vk=t=v_0,v_1,...,v_k=t(viv_i和vi+1v_{i+1}相
2017-10-24 23:48:19
309
原创 2017ACM-ICPC沈阳站流水账
打铁打铁打铁打铁打铁了!这次去程坐飞机,zhangjiatao1因为要选举副主席所以没有同我、阿姨一起出发。周五蹭了一节微机课(孤单地)后就拉上行李箱出发,坐s1线的时候感觉要回家了。。阿姨是第一次坐飞机,超级紧张吧大概,因为zhangjitao1没来,所以没有特别表现出来,我也不知道她心里到底多紧张。在平民机场大巴上遇见了背着google包、全身上下散发着“我是Acmer”的大佬,大概是南大
2017-10-24 20:01:56
949
原创 某同学的期末大作业 UNO的简单实现
这破玩意儿写了好久,代码又长又丑。实在是拿不出手的东西。。。。而且估计还是有很多bug,从老哥结婚准备那天开始零零散散地写到现在,果然写代码战线拖太长不行啊。。。。姑且写了很长, 在这里放出来首先这是他们老师放出来的.h,代码之所以很乱也有原因是要实现他们老师要求的function!!!(其实是自己菜吧)
2017-10-12 21:28:28
996
原创 Hdu4819 Mosaic 二维线段树维护区间最值+单点更新
MosaicTime Limit: 10000/5000 MS (Java/Others) Memory Limit: 102400/102400 K (Java/Others)Total Submission(s): 2077 Accepted Submission(s): 927Problem DescriptionThe God of sheep
2017-10-02 18:49:30
447
原创 hdu5091 线段树扫描线
Recently, the γ galaxies broke out Star Wars. Each planet is warring for resources. In the Star Wars, Planet X is under attack by other planets. Now, a large wave of enemy spaceships is approaching. T
2017-10-02 01:31:33
355
原创 时隔一年的再开 紫书Uva1589 象棋 模拟
XiangqiTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 1668 Accepted: 421DescriptionXiangqi is one of the most popular two-player board games in China
2017-09-29 18:57:12
404
原创 UVA548 中序后序构造二叉树
详见字书p157代码:#include #include #include #include #include #include #include using namespace std;const int maxn = 10010;const int inf = 0x3f3f3f3f;int n;int inOrder[maxn],postOrder[maxn];
2017-04-20 20:08:41
346
原创 用自己mac装tomcat/mySQL遇到的各种问题
写第一个简答的jsp页面就报错了。。。各种语法问题。。。这玩意儿有没有啥集成开发环境啊。。。做虚拟目录的时候也有问题。。。以后如果想新加什么东西的话,绝对路径要这么写:/Users/user/Documents才访问得到
2017-03-27 13:58:33
582
原创 HHU2017杂题训练(一)
来自zyyyyy的留言:久远的浙大机试题...A - 找出直系亲属 如果A,B是C的父母亲,则A,B是C的parent,C是A,B的child,如果A,B是C的(外)祖父,祖母,则A,B是C的grandparent,C是A,B的grandchild,如果A,B是C的(外)曾祖父,曾祖母,则A,B是C的great-grandparent,C是A,B的great-gra
2017-03-24 22:15:23
582
原创 2017浙江理工校赛 A、D、I 待补完
可做题很多,这几天补完!Problem A: 回文Time Limit: 1 Sec Memory Limit: 128 MBSubmit: 1672 Solved: 517Description小王想知道一个字符串是否为ABA’型字符串。ABA’型字符串的定义:S=ABA’,A,B,A’都是原字符串的子串(不能是空串),A’的意思是A的反转串,B不
2017-03-22 21:04:25
610
原创 UVA679 / UVA122 学习二叉树
详细内容翻阅紫书p148~p155#include #include #include #include #include #include #include using namespace std;int d,I;const int maxn = 1048586;int main(){ int i,t,k; scanf("%
2017-03-14 15:13:44
326
原创 AtCoder Grand Contest 011 A\B 贪心、二分
A - Airport Bus時間制限 : 2sec / メモリ制限 : 256MB配点 : 300 点問題文高橋空港には,毎日飛行機で N 人の乗客が到着します. i 番目の乗客は時刻 Ti に到着します.高橋空港に到着する乗客は全員バスで市内へ移動します.どのバスも定員は C 人であり,C 人以下の乗客を乗せることができます. 飛行機の乗客は,飛
2017-03-12 21:58:00
517
原创 Round A APAC Test 2017 Problem C. Jane's Flower Shop 二分、高精度要求
Problem C. Jane's Flower ShopThis contest is open for practice. You can try every problem as many times as you like, though we won't keep track of which problems you solve. Read the Quick-Star
2017-03-12 01:19:05
497
原创 Codeforces 780C Andryusha and Colored Balloons 搜索dfs
C. Andryusha and Colored Balloonstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputAndryusha goes through a
2017-03-11 14:58:31
470
原创 Mutual Training for Wannafly Union #6 [SPOJ - VECTAR1] Matrices with XOR property 二维线段树 数位dp
D - Matrices with XOR property SPOJ - VECTAR1Imagine A is a NxM matrix with two basic properties1) Each element in the matrix is distinct and lies in the range of 12) For any two cel
2017-03-11 12:57:48
367
原创 Mutual Training for Wannafly Union #6 A(bfs)/B(规律)/E (并查集)
阿三们的oj呢,第一次印度的题。托这个服,根本查不到题解呢^q^。D题想了一半没有继续下去,太可惜了。。。。有意思的阿三oj的题号居然不是数字,而是字母组成的,o mo shi ro iA - Grid (spoj id:SERGRID)You are on an nxm grid where each square on the grid has a digi
2017-03-09 15:31:12
561
原创 Codeforces Round #403 Div. 2 A B 二分
A. Andryusha and Sockstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputAndryusha is an orderly boy and like
2017-03-07 23:53:22
357
原创 Kickstart Round A 2017 Problem A. Square Counting 公式、数论逆元、除法取模
Problem A. Square CountingThis contest is open for practice. You can try every problem as many times as you like, though we won't keep track of which problems you solve. Read the Quick-Start
2017-03-06 19:57:06
1263
原创 Kickstart Round A 2017 Problem.B Patterns Overlap 代补完
Problem B. Patterns OverlapThis contest is open for practice. You can try every problem as many times as you like, though we won't keep track of which problems you solve. Read the Quick-Start
2017-03-06 19:55:35
526
原创 Round A APAC Test 2017 Problem B.Rain
Problem B. RainThis contest is open for practice. You can try every problem as many times as you like, though we won't keep track of which problems you solve. Read the Quick-Start Guide to g
2017-03-06 19:45:51
381
原创 hdu1728 逃离迷宫 dfs搜索剪枝
逃离迷宫Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 25424 Accepted Submission(s): 6204Problem Description 给定一个m × n (m行, n列)
2017-03-03 20:02:13
387
原创 hdu2553 n皇后问题 dfs搜索 记忆化
N皇后问题Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 21710 Accepted Submission(s): 9709Problem Description在N*N的方格棋盘放置了N个皇后,使得
2017-03-02 23:06:37
327
原创 hdu1010 Tempter of the Bone dfs搜索 剪枝
Tempter of the BoneTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 116519 Accepted Submission(s): 31594Problem DescriptionThe
2017-03-02 18:03:38
273
原创 Hdu1539 Shredding Company dfs搜索
Shredding CompanyTime Limit: 5000/2000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 679 Accepted Submission(s): 222Problem DescriptionYou have j
2017-03-01 20:35:35
377
原创 hdu1425 sort 快速排序
sortTime Limit: 6000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 45942 Accepted Submission(s): 13263Problem Description给你n个整数,请按从大到小的顺序输出其
2017-02-28 18:47:09
691
原创 hdu1880魔咒词典 字符串哈希
魔咒词典Time Limit: 8000/5000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 13274 Accepted Submission(s): 3236Problem Description哈利波特在魔法学校的必修课之一就是学习魔
2017-02-27 21:26:50
348
原创 poj2299 马桶吸题使用 归并排序解
In this problem, you have to analyze a particular sorting algorithm. The algorithm processes a sequence of n distinct integers by swapping two adjacent sequence elements until the sequence is sorted i
2017-02-24 13:41:52
497
原创 AtCoder gc009 A Multiple Array
A - Multiple Array時間制限 : 2sec / メモリ制限 : 256MB配点 : 300 点問題文N 項からなる数列 A1,…,AN があり、N 個のボタンがあります。 i(1≦i≦N) 個目のボタンを押すと、数列 A の 1 項目から i 項目までの値が 1 ずつ増加します。数列 B1,…,BN が与えられます。高橋君は、これらのボタ
2017-01-23 14:33:41
460
原创 Codeforces Round #392 (Div. 2) A、B之我是zz
A. Holiday Of Equalitytime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputIn Berland it is the holiday of equal
2017-01-22 14:43:02
401
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人