Putting Boxes Together 二分找到分界点, 左边的往右移, 右边的往左移。 其实把a[ i ] - i 之后就变成了移到一个点, 然后我维护移到一个线段都要维护自闭了。 ...
分类:
编程语言 时间:
2019-05-15 00:39:33
阅读次数:
143
diverta 2019 Programming Contest 因为评测机的缘故……它unrated了。。 A Consecutive Integers B RGB Boxes …… cpp include define fi first define se second define pii p ...
分类:
其他好文 时间:
2019-05-12 10:34:05
阅读次数:
123
题目链接:CodeForces 551C GukiZ hates Boxes 解题思路: 题目要求最短时间,因此我们可以先考虑最长时间,最长时间一定是一个学生从开始走到结束,每走到一处就把该处箱子搬空,所以最长时间等于走到最后一个有箱子格子的步数ed加箱子总数sum。 接下来二分所需时间,直接搜索最 ...
分类:
其他好文 时间:
2019-05-07 21:16:18
阅读次数:
132
描述 Imagine you are standing inside a two dimensional maze composed of square cells which may or may not be filled with rock. You can move north, south ...
分类:
其他好文 时间:
2019-05-02 21:27:48
阅读次数:
166
#include #include #include #include #include #include #include #include #include #include #define REP(i,a,n) for(int i=a;i=a;--i) #define hr putchar(1... ...
分类:
其他好文 时间:
2019-04-23 09:15:19
阅读次数:
148
import pandas as pd import numpy as np from sklearn.linear_model import Lasso from sklearn.ensemble import GradientBoostingRegressor from sklearn.pipe... ...
分类:
其他好文 时间:
2019-04-08 11:56:20
阅读次数:
214
地址。 很重要的搜索题。★★★ 吐槽:算是写过的一道码量比较大的搜索题了,细节多,还比较毒瘤。虽然是一遍AC的,其实我提前偷了大数据,但是思路还是想了好长时间,照理说想了半小时出不来,我就会翻题解,但是这次总觉得自己快想出来了结果磕了两个小时才想到正解上。嘛主要还是我太弱了QwQ。 题目内容很简单。 ...
分类:
其他好文 时间:
2019-03-27 18:27:03
阅读次数:
188
题目传送门 首先说明我这个代码和lyd的有点不同:可能更加复杂 既然要求以箱子步数为第一关键字,人的步数为第二关键字,那么我们可以想先找到箱子的最短路径。但单单找到箱子的最短路肯定不行啊,因为有时候不能被推动,怎样确定一条既满足最短又满足可行的箱子路径呢,其实这就是一种有限制的BFS。 对于箱子: ...
分类:
其他好文 时间:
2019-03-12 18:01:31
阅读次数:
243
You can see a (4 × 4) grid below. Can you tell me how many squares and rectangles are hidden there? You can assume that squares are not rectangles. Pe ...
分类:
其他好文 时间:
2019-02-20 09:24:36
阅读次数:
205
https://vjudge.net/problem/UVA-12657 题目 你有一行盒子,从左到右依次编号为1, 2, 3,…, n。你可以执行四种指令: 1 X Y表示把盒子X移动到盒子Y左边(如果X已经在Y的左边则忽略此指令)。 2 X Y表示把盒子X移动到盒子Y右边(如果X已经在Y的右边则 ...
分类:
其他好文 时间:
2019-02-16 13:35:33
阅读次数:
202