自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

Fire Dancer

有些事必须干,你干就是了,绝不高谈阔论。不要去判断要做的这些事是否合理。它们没法判断。你干你的就是了,干完之后就忘记。

  • 博客(32)
  • 收藏
  • 关注

原创 比赛记录contest13

比赛记录contest13比赛链接AProblem description 就是说给你一个字符串,描述了一个天平,然后要求输出这个天平的平衡情况。Solution仔细分析一下,这个题就是强行枚举,先从左往右扫,找到支点,然后左右两边分别计算力矩,比下大小,恶心的是要开long long,因此WA了一发,可见数据范围的重要性using namespace std;#include<cstdio

2017-06-29 19:11:06 300

原创 HDU4758AC自动机DP

On the beaming day of 60th anniversary of NJUST, as a military college which was Second Artillery Academy of Harbin Military Engineering Institute before, queue phalanx is a special landscape. Here is

2017-06-28 18:07:10 280

原创 URAL1970

Vova was walking along the Statue Square (皇后像廣場) in Hong Kong, when he noticed that the square was paved with multi-colored square tiles. Vova took a careful look at the tiles and realized that they fo

2017-06-28 18:05:21 374

原创 E - Okabe and El Psy Kongroo CodeForces - 821E

Okabe likes to take walks but knows that spies from the Organization could be anywhere; that’s why he wants to know how many different walks he can take in his city safely. Okabe’s city can be represen

2017-06-28 18:03:16 406

原创 D - Okabe and City CodeForces - 821D

Okabe likes to be able to walk through his city on a path lit by street lamps. That way, he doesn’t get beaten up by schoolchildren.Okabe’s city is represented by a 2D grid of cells. Rows are numbered

2017-06-28 17:59:13 359

原创 HDU4750

With the 60th anniversary celebration of Nanjing University of Science and Technology coming soon, the university sets n tourist spots to welcome guests. Of course, Redwood forests in our university an

2017-06-25 21:36:09 344

原创 codeforces544E

You have multiset of n strings of the same length, consisting of lowercase English letters. We will say that those strings are easy to remember if for each string there is some position i and some lett

2017-06-25 21:28:51 635

原创 codefores544D

In some country there are exactly n cities and m bidirectional roads connecting the cities. Cities are numbered with integers from 1 to n. If cities a and b are connected by a road, then in an hour you

2017-06-25 21:15:57 420

原创 codeforces544C

Programmers working on a large project have just received a task to write exactly m lines of code. There are n programmers working on a project, the i-th of them makes exactly ai bugs in every line of

2017-06-25 21:10:45 340

原创 codeforces544

You are given a string q. A sequence of k strings s1, s2, …, sk is called beautiful, if the concatenation of these strings is string q (formally, s1 + s2 + … + sk = q) and the first characters of these

2017-06-19 21:24:20 456

原创 codeforces712

There are n integers b1, b2, …, bn written in a row. For all i from 1 to n, values ai are defined by the crows performing the following procedure:The crow sets ai initially 0. The crow then adds bi to

2017-06-19 21:16:07 443

原创 codeforces160A

Imagine that you have a twin brother or sister. Having another person that looks exactly like you seems very unusual. It’s hard to say if having something of an alter ego is good or bad. And if you do

2017-06-19 21:06:41 1381

原创 codeforces 160

Today Tavas got his test result as an integer score and he wants to share it with his girlfriend, Nafas.His phone operating system is Tavdroid, and its keyboard doesn’t have any digits! He wants to sha

2017-06-19 20:52:18 767

原创 Codeforces514

这次考试题目顺序换过了,萎了,QAQ Luke Skywalker gave Chewbacca an integer number x. Chewbacca isn’t good at numbers but he loves inverting digits in them. Inverting digit t means replacing it with digit 9 - t.Help

2017-06-16 07:31:52 505

原创 codeforces510

Fox Ciel starts to learn programming. The first task is drawing a fox! However, that turns out to be too hard for a beginner, so she decides to draw a snake instead.A snake is a pattern on a n by m tab

2017-06-16 07:07:31 441

原创 CQOI三角形,神模拟

画一个等边三角形,把三边的中点连接起来,得到四个三角形,把它们称为T1,T2,T3,T4,如图1。把前三个三角形也这样划分,得到12个更小的三角形:T11,T12,T13,T14,T21,T22,T23,T24,T31,T32,T33,T34,如图2。把编号以1,2,3结尾的三角形又继续划分…最后得到的分形称为Sierpinski三角形。 1.jpg    如果B不包含A,且A的某一条完整的边是

2017-06-13 19:41:25 470

原创 Codeforces 294比赛记

Shaass has decided to hunt some birds. There are n horizontal electricity wires aligned parallel to each other. Wires are numbered 1 to n from top to bottom. On each wire there are some oskols sitting

2017-06-13 18:01:09 445

原创 分点新技能+网络流

当某个点在属性不同的决策时不同时,我们考虑分点,这不失为一种好的解决问题的方法 CTSC家园 由于人类对自然的疯狂破坏,人们意识到在大约2300年之后,地球不能再居住了,于是在月球上建立了新的绿地,以便在需要时移民。令人意想不到的是,2177年冬由于未知的原因,地球环境发生了连锁崩

2017-06-13 17:39:57 310

原创 AC自动机——棋局定式

JLOI棋局定式 在“jloi-08”游戏中,还存有非常非常多的棋局定式,也就是常会用到的下棋的组合。有时在学习一个著名棋局时,电脑会考一考刘先生:在这局棋里面,有多少个定式啊?分别是什么啊?      对于30~40步的普通棋局,刘先生还能回答出来,可是有时候2个实力相当的大牛下的棋局,2000000步都有可能。如果电脑对这样的棋局提上面的问题时,刘先生就必须写一个程序来帮助自己了。可是,刘

2017-06-13 06:59:50 620

原创 1432: [ZJOI2009]Function

DescriptionInput一行两个整数n; k。 Output一行一个整数,表示n 个函数第k 层最少能由多少段组成。 Sample Input1 1Sample Output1HINT对于100% 的数据满足1 ≤ k ≤ n ≤ 100。Source没能给出好的证明待填坑#include<bits/stdc++.h>using namespace std;int n,k;int

2017-06-09 22:19:44 320 1

原创 行列式求值

给一个n×n的矩阵A,请求出detA对p取模后的值。输入格式: 第一行,两个整数n(1≤n≤200),p(1≤p≤109); 接下来n行,每行n个数,第i+1行第j个数表示Ai,j(0≤|Ai,j|≤109)。 输出格式: 一个数,表示答案。 样例输入: 2 4 5 2 -2 7 样例输出: 3 数据范围: 对于10%的数据,n=2; 另有30%的数据,n≤50; 另有4

2017-06-09 22:18:01 3176

原创 ZJOI2005独木舟上的旅行

我们计划搞一次独木舟旅游活动。独木舟可以在港口租到,并且它们之间是没有区别的。一条独木舟上最多只能乘坐两个人,且乘客的总重量不能超过独木舟的最大承载量。我们想要尽可能的减少我们在这次活动中的花销,所以要找出可以安置所有旅客的最少的独木舟的条数。 任务: 请写一个程序: 读入独木舟的最大承载量,旅客的数目和每位旅客的重量; 根据给出的规则,计算要安置所有旅客所必须最少的独木舟的条数; 把结果

2017-06-09 22:01:34 738

原创 清理雪道

滑雪场坐落在FJ省西北部的若干座山上。 从空中鸟瞰,滑雪场可以看作一个有向无环图,每条弧代表一个斜坡(即雪道),弧的方向代表斜坡下降的方向。 你的团队负责每周定时清理雪道。你们拥有一架直升飞机,每次飞行可以从总部带一个人降落到滑雪场的某个地点,然后再飞回总部。从降落的地点出发,这个人可以顺着斜坡向下滑行,并清理他所经过的雪道。 由于每次飞行的耗费是固定的,为了最小化耗费,你想知道如何用最少的飞

2017-06-09 18:44:42 336

原创 K大数查询——整体二分套线段树

3110: [Zjoi2013]K大数查询 Time Limit: 20 Sec Memory Limit: 512 MB Submit: 5881 Solved: 1958 [Submit][Status][Discuss] Description 有N个位置,M个操作。操作有两种,每次操作如果是1 a b c的形式表示在第a个位置到第b个位置,每个位置加入一个数c 如果是2 a

2017-06-09 10:41:56 523

原创 整体二分入门——区间k小数查询

DescriptionYou are working for Macrohard company in data structures department. After failing your previous task about key insertion you were asked to write a new data structure that would be able to r

2017-06-08 20:54:36 464

原创 树状数组模板2

如题,已知一个数列,你需要进行下面两种操作:1.将某区间每一个数数加上x2.求出某一个数的和输入输出格式输入格式: 第一行包含两个整数N、M,分别表示该数列数字的个数和操作的总个数。第二行包含N个用空格分隔的整数,其中第i个数字表示数列第i项的初始值。接下来M行每行包含2或4个整数,表示一个操作,具体如下:操作1: 格式:1 x y k 含义:将区间[x,y]内每个数加上k操作2: 格式:2 x

2017-06-07 20:05:14 656 2

原创 斜率优化——炸铁轨

在一条直线上,有n个火车站,第i条铁轨连接着第i个和第i+1个火车站。 每个火车站都有一个花费wi。 定义所有火车站的总花费为∑i和j可以互相到达wiwj。 比如有4个火车站,权值分别为4,5,1,2。 如图:4 — 5 — 1 — 2,总花费为:4*5 + 4*1 + 4*2 + 5*1 + 5*2 + 1*2 = 49 现在给你机会去炸掉m条铁轨,希望你能让火车站的总花费最小。 假设

2017-06-06 07:47:07 595 1

原创 最小覆盖圆+定点旋转+C++三角函数使用 BZOJ信号增幅仪

无线网络基站在理想状况下有效信号覆盖范围是个圆形。而无线基站的功耗与圆的半径的平方成正比。 现给出平面上若干网络用户的位置,请你选择一个合适的位置建设无线基站…. 就在你拿起键盘准备开始敲代码的时候,你的好朋友发明家 SHTSC 突然出现了。SHTSC 刚刚完成了他的新发明——无线信号增幅仪。增幅仪能够在不增加无线基站功耗的前提下,使得有效信号的覆盖范围在某一特定方向上伸长若干倍。即:使用了增幅

2017-06-05 17:44:12 469

原创 模拟题选写——六边形

棋盘是由许多个六边形构成的,共有5种不同的六边形编号为1到5,棋盘的生成规 则如下: 1.从中心的一个六边形开始,逆时针向外生成一个个六边形。 2.对于刚生成的一个六边形,我们要确定它的种类,它的种类必须满足与已生成的相 邻的六边形不同。 3.如果有多个种类可以选,我们选择出现次数最少的种类。 4.情况3下还有多个种类可以选,我们选择数字编号最小的。 现在要你求第N个生成的六边形的编号

2017-06-05 16:42:47 1096

原创 斜率优化入门

HDU3507 Zero has an old printer that doesn’t work well sometimes. As it is antique, he still like to use it to print articles. But it is too old to work for a long time and it will certainly wear and

2017-06-05 16:22:22 376

转载 后缀自动机详解

后缀自动机后缀自动机(单词的有向无环图)——是一种强有力的数据结构,让你能够解决许多字符串问题。例如,使用后缀自动机可以在某一字符串中搜索另一字符串的所有出现位置,或者计算不同子串的个数——这都能在线性时间内解决。   直觉上,后缀自动机可以被理解为所有子串的简明信息。一个重要的事实是,后缀自动机以压缩后的形式包含了一个长度为n的字符串的所有信息,仅

2017-06-02 11:13:14 607

原创 中国剩余定理题——Biorhythms

人生来就有三个生理周期,分别为体力、感情和智力周期,它们的周期长度为23天、28天和33天。每一个周期中有一天是高峰。在高峰这天,人会在相应的方面表现出色。例如,智力周期的高峰,人会思维敏捷,精力容易高度集中。因为三个周期的周长不同,所以通常三个周期的高峰不会落在同一天。对于每个人,我们想知道何时三个高峰落在同一天。对于每个周期,我们会给出从当前年份的第一天开始,到出现高峰的天数(不一定是第一次高峰

2017-06-01 19:38:05 762 2

空空如也

空空如也

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

TA关注的人

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