随笔分类 - 其他——排序/偏序
摘要:http://www.lydsy.com/JudgeOnline/problem.php?id=3997 最小链覆盖=最长反链长度 所以题目等价于寻找一条从右上角到左下角的最长路 #include<cstdio> #include<cstring> #include<iostream> using
阅读全文
摘要:http://www.lydsy.com/JudgeOnline/problem.php?id=2244 每枚导弹成功拦截的概率 = 包含它的最长上升子序列个数/最长上升子序列总个数 pre_len [i] 表示以i结尾的最长不下降子序列的长度 pre_sum[i] 表示对应长度下的方案数 suf_
阅读全文
摘要:http://www.lydsy.com/JudgeOnline/problem.php?id=3262 三维偏序 第一维排序,第二维CDQ分治,第三维树状数组 #include<cstdio> #include<iostream> #include<algorithm> #define lowbi
阅读全文
摘要:期望得分:100+50+20=170 实际得分:10+50+20=80 1. 纸牌 题目描述 在桌面上放着n张纸牌,每张纸牌有两面,每面都写着一个非负整数。你的邪王真眼可以看到所有牌朝上的一面和朝下的一面写的数字。现在你需要将一些牌翻过来,使得所有牌朝上的一面中,至少有一半(≥n/2)的数字是一样的
阅读全文
摘要:期望得分:80+30+70=180 实际得分:10+30+70=110 T1 水题(water) Time Limit:1000ms Memory Limit:128MB 题目描述 LYK出了道水题。 这个水题是这样的:有两副牌,每副牌都有n张。 对于第一副牌的每张牌长和宽分别是xi和yi。对于第二
阅读全文
摘要:期望得分:0+40+30=70 实际得分:0+10+10=20 题目修改:只能由0变1,只能用一次操作 大模拟 #include<cstdio> #include<cstring> using namespace std; char s[2001]; int len,n; int cnt[2001]
阅读全文
摘要:Nested Dolls http://poj.org/problem?id=3636 Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 8630 Accepted: 2367 Description Dilworth is the
阅读全文
摘要:Wooden Sticks http://poj.org/problem?id=1065 Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 24062 Accepted: 10369 Description There is a p
阅读全文
摘要:期望得分:100+60+0=160 实际得分:100+30+0=130 考场上用的哈希 #include<cstdio> #include<cstring> #include<algorithm> using namespace std; #define mod 1000003 #define mo
阅读全文
摘要:1597: [Usaco2008 Mar]土地购买 Description 农夫John准备扩大他的农场,他正在考虑N (1 <= N <= 50,000) 块长方形的土地. 每块土地的长宽满足(1 <= 宽 <= 1,000,000; 1 <= 长 <= 1,000,000). 每块土地的价格是它
阅读全文
摘要:题目描述 Farmer John's N cows (2 <= N <= 500) have joined the social network "MooBook". Each cow has one or more friends with whom they interact on MooBoo
阅读全文
摘要:http://www.cogs.pro/cogs/problem/problem.php?pid=2507 时间限制:1 s 内存限制:256 MB 【题目描述】 成功找到了学长之后学姐感觉到有些饿,于是决定去附近的零食店给自己和学长买些零食。 焦作市的有n家零食店,由m条道路连接着这些零食店,每条
阅读全文
摘要:https://www.luogu.org/problem/show?pid=2966 题目描述 Like everyone else, FJ is always thinking up ways to increase his revenue. To this end, he has set up
阅读全文
摘要:C. Little Elephant and Problem time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output The Littl
阅读全文
摘要:4104: [Thu Summer Camp 2015]解密运算 Description 对于一个长度为N的字符串,我们在字符串的末尾添加一个特殊的字符"."。之后将字符串视为一个环,从位置1,2,3,...,N+1为起点读出N+1个字符,就能得到N+1个字符串。 比如对于字符串“ABCAAA”,我
阅读全文
摘要:https://www.luogu.org/problem/lists?name=&orderitem=pid&tag=83%7C30 期望得分:100+100+100=300 实际得分:100+10+0=110 T2 思路有漏洞 T3 求到lca的什么什么值,指跳了一个点,没管另一个,丢100 T
阅读全文