随笔分类 -  难度1

熟悉的模板题
摘要:题目 http://poj.org/problem?id=1201 题意 给你n个整数区间(5e4数量级),要求给出一个最小的整数集合,这个整数集合至少与第i个区间有ci个重合整数 思路 很裸的差分约束,若令dp[w]为在[0, w]中取多少个整数,明显dp[bi] - dp[ai-1] = ci。 阅读全文
posted @ 2021-02-03 17:56 雪溯 阅读(66) 评论(0) 推荐(0) 编辑
摘要:题目: https://cryptopals.com/sets/1/challenges/6 思路: Here's how: 解: 感想: keysz=29,这个实际上是硬暴力来的 其实还不完全,直接按照E的数目最多来拼是Terminator X: Br,ng thm noise 但实际上应该是Br 阅读全文
posted @ 2019-12-07 02:06 雪溯 阅读(243) 评论(0) 推荐(0) 编辑
摘要:题目 https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=4167 题意 有n+1条平行于x轴的线段,最底下的线段是[0, w],站在最下面的第0条线段上的某个 阅读全文
posted @ 2019-06-09 13:02 雪溯 阅读(222) 评论(0) 推荐(0) 编辑
摘要:题目 https://icpcarchive.ecs.baylor.edu/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=2095 题意 球赛,n个球队,每两个之间赛两场,胜得三分,平得1分。梦之队是胜利场数最 阅读全文
posted @ 2019-04-12 21:54 雪溯 阅读(172) 评论(0) 推荐(0) 编辑
摘要:题目 https://icpcarchive.ecs.baylor.edu/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=2726 题意 飞机,一个起飞的跑道,两个降落的跑道。每个时刻首先两个跑道降落一些飞机, 阅读全文
posted @ 2019-03-14 09:33 雪溯 阅读(121) 评论(0) 推荐(0) 编辑
摘要:题目 https://icpcarchive.ecs.baylor.edu/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=1402 题意 4个方块,每个方块每个面涂不同的颜色,问最少重涂多少面,使四个方块相同。 阅读全文
posted @ 2019-02-12 15:56 雪溯 阅读(152) 评论(0) 推荐(0) 编辑
摘要:题目 https://icpcarchive.ecs.baylor.edu/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=996 题意 被射击掉了一些列的魔方。组成模仿的每个方块的六个面颜色相同。给六个面的视图 阅读全文
posted @ 2019-02-09 02:23 雪溯 阅读(158) 评论(0) 推荐(0) 编辑
摘要:题目 http://poj.org/problem?id=3080 题意 有m个(2<=m<=10)不包含空格的字符串,长度为60个字符,求所有字符串中都出现过的最长公共子序列,若该子序列长度小于3,输出"no significant commonalities",否则,输出字典序最小且长度最大的公 阅读全文
posted @ 2017-02-07 02:25 雪溯 阅读(291) 评论(0) 推荐(0) 编辑
摘要:题目 http://poj.org/problem?id=3436 题意 有一条生产线,生产的产品共有p个(p<=10)零件,生产线上共有n台(n<=50)机器,每台机器可以每小时加工Qi个产品,但有输入要求,即对于部件Pi,输入要求会说明要求其存在(1),不存在(0)或者无要求(2),每台机器的输 阅读全文
posted @ 2017-02-03 15:39 雪溯 阅读(196) 评论(0) 推荐(0) 编辑
摘要:思路:设现在可用区间在nums1是[s1,t1),nums2:[s2,t2)1.当一个数组可用区间为0的时候,由于另一个数组是已经排过序的,所以直接可得当要取的是最小值或最大值时,也直接可得2.明显两个数组总长度为偶数的时候需要取最中间两个元素/2.0,长度为奇数时,只需要求最中间那个.所以只需要分... 阅读全文
posted @ 2015-09-01 13:29 雪溯 阅读(192) 评论(0) 推荐(0) 编辑
摘要:https://leetcode.com/problems/longest-substring-without-repeating-characters/思路:从某点结束所能取到的最早开头是到目前出现倒数第二次的字符的最末位置后一位如图:(S代表起点,T代表终点)abcabcab**S*T假设现在在... 阅读全文
posted @ 2015-08-27 11:37 雪溯 阅读(156) 评论(0) 推荐(0) 编辑
摘要:https://leetcode.com/problems/nth-highest-salary/ATTENTION:limit 子句只能接受int常量,不能接受运算式CREATE FUNCTION getNthHighestSalary(N INT) RETURNS INTBEGINSET N =... 阅读全文
posted @ 2015-08-26 15:42 雪溯 阅读(217) 评论(0) 推荐(0) 编辑
摘要:https://leetcode.com/problems/second-highest-salary/Write a SQL query to get the second highest salary from theEmployeetable.+----+--------+| Id | Sal... 阅读全文
posted @ 2015-08-26 07:58 雪溯 阅读(150) 评论(0) 推荐(0) 编辑
摘要:http://poj.org/problem?id=3020 1 #include 2 #include 3 #include 4 using namespace std; 5 char maz[62][62]; 6 int e[500][500]; 7 int d[4][2]={0,1,0,... 阅读全文
posted @ 2015-08-24 16:03 雪溯 阅读(246) 评论(0) 推荐(0) 编辑
摘要:http://poj.org/problem?id=3041#include #include #include using namespace std;int e[1004][1004];bool vis[1004];vector G[1004];int n,m;int dfs(int s){ ... 阅读全文
posted @ 2015-08-24 16:01 雪溯 阅读(190) 评论(0) 推荐(0) 编辑
摘要:http://poj.org/problem?id=1328思路:1.肯定y大于d的情况下答案为-1,其他时候必定有非负整数解2.x,y同时考虑是较为麻烦的,想办法消掉y,用d^2-y^2获得圆心允许范围,问题转化为在许多圆心允许范围内取尽可能少的点,也即在许多线段上取尽可能少的点,使得所有线段上都... 阅读全文
posted @ 2015-08-07 03:11 雪溯 阅读(157) 评论(0) 推荐(0) 编辑
摘要:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=4835由题意,有:(x1-x11)^2 + (x2-x12)^2 ... = D[1]^2(x1-x21)^2 + (x2-x22)^2 ... = D[2]^2...(x1-x1... 阅读全文
posted @ 2015-05-17 12:28 雪溯 阅读(156) 评论(0) 推荐(0) 编辑
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=4036一开始以为需要用斜抛,结果发现只需要用能量守恒定律?+与最大速度的坏土豆速度保持一致#include #include #include #include using namespace std;const ... 阅读全文
posted @ 2015-05-14 00:47 雪溯 阅读(173) 评论(0) 推荐(0) 编辑
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=4050题意:现在主角站在0处,需要到达大于n的位置主角要进入的格子有三种状态:0. 不能进入1. 能进入左脚,下一步出右脚2. 能进入右脚,下一步出左脚3. 两只脚都能进入,而且下一步迈出左右脚都可.也就是说,如果... 阅读全文
posted @ 2015-05-12 20:07 雪溯 阅读(188) 评论(0) 推荐(0) 编辑
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=1560仔细读题(!),则可发现这道题要求的是一个最短的字符串,该字符串的不连续子序列中包含题目所给的所有字符串因为总共只有40个字符,可以尝试使用A*搜索1.存储状态时直接存储40个字符,每个字符4种可能是肯定不行... 阅读全文
posted @ 2015-04-09 23:18 雪溯 阅读(361) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示