自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(85)
  • 收藏
  • 关注

原创 POJ 3630 Phone List 字典树

Given a list of phone numbers, determine if it is consistent in the sense that no number is the prefix of another. Let's say the phone catalogue listed these numbers:Emergency 911 Alice 97 625 999...

2019-04-25 16:44:56 202

原创 HDU3294 Girls' research 马拉车模板题

One day, sailormoon girls are so delighted that they intend to research about palindromic strings. Operation contains two steps:First step: girls will write a long string (only contains lower case) ...

2019-04-22 22:26:50 174

原创 HDU 3374 String Problem 字符串最大最小表示法 模板题

Give you a string with length N, you can generate N strings by left shifts. For example let consider the string “SKYLONG”, we can generate seven strings:String RankSKYLONG 1KYLONGS 2YLONGSK...

2019-04-20 16:35:02 177

原创 花布条剪饰条

一块花布条,里面有些图案,另有一块直接可用的小饰条,里面也有一些图案。对于给定的花布条和小饰条,计算一下能从花布条中尽可能剪出几块小饰条来呢?Input输入中含有一些数据,分别是成对出现的花布条和小饰条,其布条都是用可见ASCII字符表示的,可见的ASCII字符有多少个,布条的花纹也有多少种花样。花纹条和小饰条不会超过1000个字符长。如果遇见#字符,则不再进行工作。Output...

2019-04-19 15:03:36 471

原创 hdu 1255 覆盖的面积 扫描线求矩形面积交 离散化

给定平面上若干矩形,求出被这些矩形覆盖过至少两次的区域的面积.Input输入数据的第一行是一个正整数T(1<=T<=100),代表测试数据的数量.每个测试数据的第一行是一个正整数N(1<=N<=1000),代表矩形的数量,然后是N行数据,每一行包含四个浮点数,代表平面上的一个矩形的左上角坐标和右下角坐标,矩形的上下边和X轴平行,左右边和Y轴平行.坐标...

2019-04-17 22:06:38 294

原创 Picture 扫描线求周长

A number of rectangular posters, photographs and other pictures of the same shape are pasted on a wall. Their sides are all vertical or horizontal. Each rectangle can be partially or totally covere...

2019-04-16 17:27:59 416

原创 E - Xenia and Bit Operations CodeForces - 339D 线段树

Xenia the beginner programmer has a sequencea, consisting of2nnon-negative integers:a1, a2, ..., a2n. Xenia is currently studying bit operations. To better understand how they work, Xenia decided ...

2019-04-14 17:31:47 151

原创 C - Number of Ways CodeForces - 466C

给定一个序列,问有多少种方案可以将此序列分割成3个序列元素和完全相同的子序列。(子序列不能为空)。即问有多少个点对(i,j)满足a[1]+...+a[i-1]=a[i]+a[i+1]+...+a[j]=a[j+1]+a[j+2]+...+a[n]Input第一行一个整数n,表示序列长度。(1<=n<=5*10^5) 第二行n个整数分别表示序列的元素。(|a[i]|<=10...

2019-04-14 16:56:48 175

原创 Pixel density 模拟

DescriptionPixels per inch (PPI) or pixel density is a measurement of the resolution of devices in various contexts; typically computer displays, image scanners, and digital camera image sensors. No...

2019-04-12 21:27:03 239

原创 FATE 二维完全背包

最近xhd正在玩一款叫做FATE的游戏,为了得到极品装备,xhd在不停的杀怪做任务。久而久之xhd开始对杀怪产生的厌恶感,但又不得不通过杀怪来升完这最后一级。现在的问题是,xhd升掉最后一级还需n的经验值,xhd还留有m的忍耐度,每杀一个怪xhd会得到相应的经验,并减掉相应的忍耐度。当忍耐度降到0或者0以下时,xhd就不会玩这游戏。xhd还说了他最多只杀s只怪。请问他能升掉这最后一级吗?Inp...

2019-04-11 20:56:39 99

原创 Pick apples 贪心+完全背包

DescriptionOnce ago, there is a mystery yard which only produces three kinds of apples. The number of each kind is infinite. A girl carrying a big bag comes into the yard. She is so surprised becaus...

2019-04-10 22:30:11 246

原创 Equivalent Strings CodeForces - 559B 递归

Today on a lecture about strings Gerald learned a new definition of string equivalency. Two stringsaandbof equal length are calledequivalentin one of the two cases:They are equal. If we split...

2019-04-08 15:52:57 162

原创 Bits CodeForces - 484A 贪心

Let's denote asthe number of bits set ('1' bits) in the binary representation of the non-negative integerx.You are given multiple queries consisting of pairs of integerslandr. For each query, ...

2019-04-07 21:06:33 102

原创 HDU 1542 Atlantis 线段树+扫描线+离散化 矩形面积并

There are several ancient Greek texts that contain descriptions of the fabled island Atlantis. Some of these texts even include maps of parts of the island. But unfortunately, these maps describe diff...

2019-04-03 22:19:24 162

原创 HDU 4027 Can you answer these queries? 线段树 区间修改

A lot of battleships of evil are arranged in a line before the battle. Our commander decides to use our secret weapon to eliminate the battleships. Each of the battleships can be marked a value of end...

2019-04-01 22:05:58 131

原创 POJ 3667 Hotel 线段树+标记

Description:The cows are journeying north to Thunder Bay in Canada to gain cultural enrichment and enjoy a vacation on the sunny shores of Lake Superior. Bessie, ever the competent travel agent, has...

2019-04-01 17:03:57 133

原创 3.30训练

1.题目:Vicious Keyboard地址:http://codeforces.com/problemset/problem/801/A大体题意是求给出的一串字符中VK的最大数量,最多可以改变其中一个字符。AC代码:#include <iostream>#include <cstdio>#include <cstring>#inc...

2019-03-31 21:20:22 132

原创 HDU 4553 约会安排 线段树+优先级+区间最大子段

题目描述:寒假来了,又到了小明和女神们约会的季节。  小明虽为屌丝级码农,但非常活跃,女神们常常在小明网上的大段发言后热情回复“呵呵”,所以,小明的最爱就是和女神们约会。与此同时,也有很多基友找他开黑,由于数量实在过于巨大,怎么安排时间便成了小明的一大心事。  我们已知小明一共有T的空闲时间,期间会有很多女神或者基友来找小明。  作为一个操作系统曾经怒考71分的大神,小明想到了一个...

2019-03-30 16:27:07 155

原创 Can you answer these queries III 线段树求区间最大字段和

题目:You are given a sequence A of N (N <= 50000) integers between -10000 and 10000. On this sequence you have to apply M (M <= 50000) operations:modify the i-th element in the sequence or for...

2019-03-28 22:00:46 697 2

原创 Mayor's posters 线段树+离散化

题目地址:http://poj.org/problem?id=2528首先第一行要输入c,表示进行c个测试案例。题意大体是有n(1 <= n <= 10000)个人往墙上贴海报,每个人给出贴的范围li,ri(1 <= li<= ri <= 10000000),问最后还能看见多少海报(完整的不完整的都算).先说一下什么是离散化,如果线段树要开的区间...

2019-03-28 09:44:30 117

原创 A Simple Problem with Integers 线段树 区间更新

题目:You haveNintegers,A1,A2, ... ,AN. You need to deal with two kinds of operations. One type of operation is to add some given number to each number in a given interval. The other is to ask for...

2019-03-27 11:22:28 79

原创 Benches CodeForces - 1042A

题目:There arennbenches in the Berland Central park. It is known thataiaipeople are currently sitting on theii-th bench. Anothermmpeople are coming to the park and each of them is going to have...

2019-03-16 10:27:18 518

原创 学霸的迷宫 bfs+记录路径

问题描述  学霸抢走了大家的作业,班长为了帮同学们找回作业,决定去找学霸决斗。但学霸为了不要别人打扰,住在一个城堡里,城堡外面是一个二维的格子迷宫,要进城堡必须得先通过迷宫。因为班长还有妹子要陪,磨刀不误砍柴功,他为了节约时间,从线人那里搞到了迷宫的地图,准备提前计算最短的路线。可是他现在正向妹子解释这件事情,于是就委托你帮他找一条最短的路线。输入格式  第一行两个整数n, m,为迷宫...

2019-03-06 16:45:42 143

原创 身份证号码升级 字符串 模拟

问题描述  从1999年10月1日开始,公民身份证号码由15位数字增至18位。(18位身份证号码简介)。升级方法为:  1、把15位身份证号码中的年份由2位(7,8位)改为四位。  2、最后添加一位验证码。验证码的计算方案:  将前 17 位分别乘以对应系数 (7 9 10 5 8 4 2 1 6 3 7 9 10 5 8 4 2) 并相加,然后除以 11 取余数,0-10 分别对应 1...

2019-02-26 17:10:47 2186

原创 蓝桥杯题目 合根植物

问题描述  w星球的一个种植园,被分成 m * n 个小格子(东西方向m行,南北方向n列)。每个格子里种了一株合根植物。  这种植物有个特点,它的根可能会沿着南北或东西方向伸展,从而与另一个格子的植物合成为一体。  如果我们告诉你哪些小格子间出现了连根现象,你能说出这个园中一共有多少株合根植物吗?输入格式  第一行,两个整数m,n,用空格分开,表示格子的行数、列数(1&lt;m,n...

2019-02-25 16:19:30 236

原创 Java知识

 1.import java.util.Scanner;public class Main { public static void main(String[] args) { Scanner cin=new Scanner (System.in); String s; s=cin.nextLine(); System.out...

2019-02-24 22:01:53 99

原创 Cut 'em all!

题目:You're given a tree with nvertices.Your task is to determine the maximum possible number of edges that can be removed in such a way that all the remaining connected components will have even si...

2019-01-28 21:44:35 302

原创 处女座与cf 模拟

题目:链接:https://ac.nowcoder.com/acm/contest/327/B来源:牛客网 众所周知,处女座经常通过打cf来调节自己的心情。今天处女座又参加了一场cf的比赛,他知道了所有的提交记录,他想知道自己的得分和排在第几名。你知道处女座的cf账号是cnz Codeforces规则如下:1.       比赛一共2小时2.       比赛有5题,A...

2019-01-25 16:25:22 283

原创 Find a way

题目描述:Pass a year learning in Hangzhou, yifenfei arrival hometown Ningbo at finally. Leave Ningbo one year, yifenfei have many people to meet. Especially a good friend Merceki.Yifenfei’s home is at ...

2019-01-25 16:11:45 154

原创 ROADS

题目:N cities named with numbers 1 ... N are connected with one-way roads. Each road has two parameters associated with it : the road length and the toll that needs to be paid for the road (expressed ...

2019-01-21 16:33:15 387

原创 Fire!

 一个迷宫,有一个地方着火了,火源可以往上下左右扩散,人可以往上下左右四个方向逃走,问逃出去。AC代码:#include &lt;iostream&gt;#include &lt;cstdio&gt;#include &lt;cstring&gt;#include &lt;algorithm&gt;#include &lt;queue&gt;using namespac...

2019-01-17 20:04:27 409

原创 全球变暖 dfs

你有一张某海域NxN像素的照片,"."表示海洋、"#"表示陆地,如下所示:........##.....##........##...####....###........其中"上下左右"四个方向上连在一起的一片陆地组成一座岛屿。例如上图就有2座岛屿。  由于全球变暖导致了海面上升,科学家预测未来几十年,岛屿边缘一个像素的范围会被海水淹没。具体来说如果一块陆地像素与海洋相邻(上下...

2018-12-25 20:56:38 340

原创 螺旋折线

如图p1.png所示的螺旋折线经过平面上所有整点恰好一次。 对于整点(X, Y),我们定义它到原点的距离dis(X, Y)是从原点到(X, Y)的螺旋折线段的长度。 例如dis(0, 1)=3, dis(-2, -1)=9 给出整点坐标(X, Y),你能计算出dis(X, Y)吗? 【输入格式】 X和Y 对于40%的数据,-1000 &lt;= X, Y &lt;= 1000 对于7...

2018-12-21 21:43:56 396

原创 进制转换

1.十六进制转八进制问题描述  给定n个十六进制正整数,输出它们对应的八进制数。输入格式  输入的第一行为一个正整数n (1&lt;=n&lt;=10)。  接下来n行,每行一个由0~9、大写字母A~F组成的字符串,表示要转换的十六进制正整数,每个十六进制数长度不超过100000。输出格式  输出n行,每行为输入对应的八进制正整数。  【注意】  输入的十六进制数不会有前导0,比如...

2018-12-19 21:13:01 358

原创 Sending Secret Messages 费用流模板

题目:Alice wants to send Bob some confidential messages. But their internet connection is not secured enough. As their names have been used in many networking schemes, they are very rich now. So, they...

2018-12-17 21:23:25 163

原创 Sudoku POJ2676

题目:Sudoku is a very simple task. A square table with 9 rows and 9 columns is divided to 9 smaller squares 3x3 as shown on the Figure. In some of the cells are written decimal digits from 1 to 9. The...

2018-12-11 17:06:46 273

原创 蓝桥杯的一个题

题目描述:一般我们在对字符串排序时,都会按照字典序排序。当字符串只包含小写字母时,相当于按字母表"abcdefghijklmnopqrstuvwxyz"的顺序排序。  现在我们打乱字母表的顺序,得到一个26个字母的新顺序。例如"bdceafghijklmnopqrstuvwxyz"代表'b'排在'd'前,'d'在'c'前,'c'在'e'前……  给定N个字符串,请你按照新的字母顺序对它...

2018-12-01 17:35:48 309

原创 Back and Forth 思维 模拟

题目:Dolphin resides in two-dimensional Cartesian plane, with the positive x-axis pointing right and the positive y-axis pointing up.Currently, he is located at the point (sx,sy). In each second, he ...

2018-11-29 10:52:49 422

原创 Factors of Factorial 求因子数

题目:You are given an integer N. Find the number of the positive divisors of N!, modulo +7.约束条件:1≤N≤输入:The input is given from Standard Input in the following format: N输出:Print the number of...

2018-11-28 17:31:30 251

原创 Menagerie 水题 递推

题目:Snuke, who loves animals, built a zoo.There are N animals in this zoo. They are conveniently numbered 1 through N, and arranged in a circle. The animal numbered i(2≤i≤N−1) is adjacent to the an...

2018-11-27 18:25:24 152

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除