其他
文章平均质量分 72
云淡风轻jzl
一路脚踏实地,不忘仰望星空。
展开
-
莫队算法-离线+分块-两个模板题
莫队算法特点:离线,时间复杂度n1.5对数组进行分块,分块的大小是n0.5,数组被分成了n0.5块。将所有查询按第一关键字为左边界的分块索引,第二关键字为右边界进行排序。详见代码cmp函数。排序完成以后,离线回答每个询问。在模板基础上,一般是修改add和del函数,指针移动时,区间维护内容稍有不同,详见下面的两个题目。题目一:SPOJ DQUERY - D-queryGiven a sequence of n numbers a1, a2, …, an and a number of d-q原创 2021-04-12 16:47:35 · 214 阅读 · 0 评论 -
CodeForces-510C-Fox And Names-拓扑排序
题目描述:Fox Ciel is going to publish a paper on FOCS (Foxes Operated Computer Systems, pronounce: “Fox”). She heard a rumor: the authors list on the paper is always sorted in the lexicographical order.After checking some examples, she found out that sometim原创 2021-01-24 10:25:50 · 181 阅读 · 0 评论 -
Excel表格的列A~Z字母与数值之间的转换
题目描述:Excel表格的第1列为A,Excel表格的第2列为B,…Excel表格的第26列为Z,…Excel表格的第28列为AB,…Excel表格的第19007列为ABCA。这里我整理了一下Excel表格的列A~Z与数值之间的转换关系。字母转换为数值:直接按位乘权值。#include<cstdio>#include<iostream>#include<algorithm>#include<cstring>using names原创 2021-01-23 16:43:34 · 1630 阅读 · 0 评论 -
网络原理(Cisco Packet Tracer)命令总结
模式一般用户模式Router>enable特权模式(所有show和ping命令)Router#configure terminal全局模式Router(config)#interface (FastEthernet/Serial)x/x接口模式Router(config-if)#ip address A.B.C.D 255.255.255.0配置网关IP地址Router(confi...转载 2020-03-08 09:11:24 · 865 阅读 · 0 评论 -
CF 1182B-Plus from Picture-暴力枚举
DescriptionYou have a given picture with size w×h. Determine if the given picture has a single “+” shape or not. A “+” shape is described below:A “+” shape has one center nonempty cell.There shoul...原创 2019-08-17 18:23:19 · 257 阅读 · 0 评论 -
POJ1054-The Troublesome Frog-两种存图方式+剪枝+模拟
题目描述:In Korea, the naughtiness of the cheonggaeguri, a small frog, is legendary. This is a well-deserved reputation, because the frogs jump through your rice paddy at night, flattening rice plants. I...原创 2019-07-03 10:16:11 · 241 阅读 · 0 评论 -
POJ 3169-Layout-差分约束+最短路
Like everyone else, cows like to stand close to their friends when queuing for feed. FJ has N (2 <= N <= 1,000) cows numbered 1…N standing along a straight line waiting for feed. The cows are st...原创 2019-08-01 11:22:58 · 132 阅读 · 0 评论 -
反转数字
题目描述:输入一个 c 语言 4字节 int 范围内的数字,输出它反转后的数字。比如12345反转后是54321,-12345反转后是-54321。如果反转后的数字不在 int 范围内就输出0输入:每行一个 int 范围内的数字,以 EOF 结尾。输出:输出反转后的数字,每行一个。样例输入:12345-12345样例输出:54321-54321核心思想:1、因为输入和输出...原创 2018-12-31 17:32:43 · 2771 阅读 · 0 评论 -
数组中出现最多的元素-快读
题目描述:给你一个数组,输出里面出现超过1/2的元素。保证有且只有一个解。输入描述:第一行是一个整数n(n <=1e7),表示测试数据的个数 ,之后每一行都是一个整数。输出描述:输出出现超过1/2的那个数字。输入样例:511123输出样例:1核心思想:因为出现最多的元素超过了1/2,所以任意两个不同的元素可以互相抵消,这样最后剩下的元素就是答案。时间复杂度降到...原创 2019-05-29 15:12:46 · 723 阅读 · 0 评论 -
SCU-4445 Right turn 建图模拟
题目描述:frog is trapped in a maze. The maze is infinitely large and divided into grids. It also consists of n obstacles, where the i-th obstacle lies in grid (xi,yi).frog is initially in grid (0,0), he...原创 2019-04-24 20:27:10 · 180 阅读 · 0 评论