任意门:http://codeforces.com/gym/101954/problem/E E. Locker Room time limit per test 2.0 s memory limit per test 256 MB input standard input output standard output There are several strange rooms in Binary Casino and one of them is a locker room. You ha…
H. Split Game time limit per test 1.0 s memory limit per test 256 MB input standard input output standard output For a long time, rich clientele of Binary Casino has been requesting a new way to gamble their money. To fulfill their wishes, the direct…
传送门 双倍经验(弱化版本) 考虑求出来heightheightheight数组之后用增量法. 也就是考虑每增加一个heightheightheight对答案产生的贡献. 算出来是∑∣S∣−heighti+1−sai\sum|S|-height_i+1-sa_i∑∣S∣−heighti​+1−sai​ 代码: #include<bits/stdc++.h> #define ri register int using namespace std; const int N=5e4+5; int n…
传送门 代码: 二分答案. 然后对于预处理的heightheightheight数组分成几段. 保证每一段中都是连续的几个heightheightheight并且这些heightheightheight都不小于二分的值. 然后查询是否有一个段中两个长度的差满足条件就行了. #include<iostream> #include<cstdio> #define ri register int using namespace std; inline int read(){ int an…
COCI 2018/2019 CONTEST #2 T4 T5 Solution abstract 花式暴力 #2 T5 Sunčanje 题意 按顺序给你1e5个长方形(左下角坐标&&长宽),对于每个长方形询问是否有后面的长方形盖住了它. 题解 暴力几何.不需要线段树维护. 用一个排序剪枝,先按矩形的左下角x坐标排序,对于每一个矩形i,枚举后面的所有矩形j,当矩形j的左下角x坐标大于i的右下角x坐标时,break掉. 数据并没有卡 代码 #include <queue> #i…
20172328 2018-2019<Java软件结构与数据结构>第二周学习总结 概述 Generalization 本周学习了第三章集合概述--栈和第四章链式结构--栈.主要讨论了集合以及用于实现集合的基本数据结构,以及集合设计的相关问题和目标.本章内容以栈为例展示与集合的设计.实现和使用等有关的问题. 教材学习内容总结 A summary of textbook 3.1集合 集合是一种聚集.组织了其他对象的对象.集合可以分为两大类:线性集合和非线性集合. 线性集合:一种其元素按照直线方式组…
2018 German Collegiate Programming Contest (GCPC 18) Attack on Alpha-Zet 建树,求lca 代码: #include <algorithm> #include <iterator> #include <iostream> #include <cstring> #include <cstdlib> #include <iomanip> #include <bit…
layout: post title: 2018 German Collegiate Programming Contest (GCPC 18) author: "luowentaoaa" catalog: true tags: mathjax: true - codeforces 传送门 付队博客 C.Coolest Ski Route (记忆化搜索) 题意 给出一个有向图,求出一个权值最长的链, 题解 暴力dfs会超时,所以直接储存每个起点能走到的最远距离 #include<…
2019 Multi-University Training Contest 8 C. Acesrc and Good Numbers 题意 \(f(d,n)\) 表示 1 到 n 中,d 出现的次数.求小于等于 x 的最大的 \(n\) 满足 \(f(d,n)=n\). 做法 令 \(g(d,n)=f(d,n)-f(n)\),我们要求小于等于 \(x\) 极大的零点. 注意到 \(n>10^{12}\) 一定不存在零点. [比赛时注意到了这点] Big-Small 战法. 取 B 等于 \(1…
2019 Multi-University Training Contest 7 A. A + B = C 题意 给出 \(a,b,c\) 解方程 \(a10^x+b10^y=c10^z\). trick hash! B.Bracket Sequences on Tree unsolved 做法 树hash,统计答案 然后疯狂wa,直到特判了最后两组数据... 假的AC F. Final Exam upsolved 题意 参加考试,确保通过 \(k\) 道题目. 复盘 先是认定了,所有题都复习相…