自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

Occult

新的一年,新的期待,新的希望,新的我,也期望新的故事。

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

原创 ZOJ 3938 Defuse the Bomb

Defuse the BombTime Limit: 2 Seconds      Memory Limit: 65536 KBThe bomb is about to explode! Please defuse it as soon as possible!There is a display showing a number from 1 to 4 on the bomb

2016-04-24 00:03:31 554

原创 ZOJ 3940 Modulo Query

Modulo QueryTime Limit: 2 Seconds      Memory Limit: 65536 KBOne day, Peter came across a function which looks like:F(1, X) = X mod A1.F(i, X) = F(i - 1, X) mod Ai, 2 ≤ i ≤ N.Where A is

2016-04-23 23:49:22 788

原创 ZOJ 3944 People Counting

People CountingTime Limit: 2 Seconds      Memory Limit: 65536 KBIn a BG (dinner gathering) for ZJU ICPC team, the coaches wanted to count the number of people present at the BG. They did that

2016-04-23 23:23:29 931

原创 ZOJ 3946 Highway Project

Highway ProjectTime Limit: 2 Seconds      Memory Limit: 65536 KBEdward, the emperor of the Marjar Empire, wants to build some bidirectional highways so that he can reach other cities from the

2016-04-23 23:17:08 597

原创 ZOJ 3947 Very Happy Great BG

Very Happy Great BGTime Limit: 2 Seconds      Memory Limit: 65536 KBThe summer training of ZJU ICPC in July is about to end. To celebrate this great and happy day, the coach of ZJU ICPC Team d

2016-04-23 23:07:38 719

原创 ZOJ 3936 Apples and Ideas

Apples and IdeasTime Limit: 2 Seconds      Memory Limit: 65536 KB"If you have an apple and I have an apple and we exchange these apples then you and I will still each have one apple. But if yo

2016-04-23 23:05:02 497

原创 ZOJ 3943 Himalayas

HimalayasTime Limit: 5 Seconds      Memory Limit: 65536 KBThe Himalayas or Himalaya is a mountain range in the Indian subcontinent, which separates the Indo-Gangetic Plain from the Tibetan Pla

2016-04-23 23:01:51 1041

原创 HDU 5674 Function

Problem DescriptionThere is a function f(n)=(a+b√)n+(a−b√)n. a and b are integers (1≤a,b≤1,000,000).Maybe the function looks complex but it is actually an integer.The question is to calculate 

2016-04-22 23:21:14 672

原创 HDU 5673 Robot

Problem DescriptionThere is a robot on the origin point of an axis.Every second, the robot can move right one unit length or do nothing.If the robot is on the right of origin point,it can also m

2016-04-22 23:19:47 595

原创 HDU 5671 Matrix

Problem DescriptionThere is a matrix M that has n rows and m columns (1≤n≤1000,1≤m≤1000).Then we perform q(1≤q≤100,000) operations:1 x y: Swap row x and row y (1≤x,y≤n);2 x y: Swap c

2016-04-22 23:15:58 394

原创 ZOJ 3606 Lazy Salesgirl

DescriptionKochiya Sanae is a lazy girl who makes and sells bread. She is an expert at bread making and selling. She can sell the i-th customer some pieces of bread at price pi for each piece. But

2016-04-21 21:16:14 384

原创 ZOJ 3609 Modular Inverse

DescriptionThe modular modular multiplicative inverse of an integer a modulo m is an integer x such that a-1≡x (mod m). This is equivalent toax≡1 (mod m).InputThere are multiple test

2016-04-19 22:14:54 408

原创 ZOJ 3607 Lazier Salesgirl

DescriptionKochiya Sanae is a lazy girl who makes and sells bread. She is an expert at bread making and selling. She can sell the i-th customer a piece of bread for price pi. But she is so lazy th

2016-04-19 22:13:34 380

原创 ZOJ 3605 Find the Marble

DescriptionAlice and Bob are playing a game. This game is played with several identical pots and one marble. When the game starts, Alice puts the pots in one line and puts the marble in one of the

2016-04-19 22:12:34 312

原创 ZOJ 3602 Count the Trees

DescriptionA binary tree is a tree data structure in which each node has at most two child nodes, usually distinguished as "left" and "right". A subtree of a tree T is a tree consisting of a node

2016-04-19 22:11:03 345

原创 回文树学习小结

最近突然捡起了好久不搞的字符串,研究了一下一直觉得很神奇的回文树。做了十来道题,现在做个小结,至于回文树是什么,随便百度就可以找到精彩的解说,偶就不在这里献丑了。相比于manacher,回文树要显得强大的多,同样是接近o(n)的复杂度,回文树只需要多一点的空间,就可以实现许多用manacher实现起来非常复杂的功能。并且就代码量而言,回文树也足够的简短,作为处理回文串的工具,实在是

2016-04-18 20:37:22 575

原创 CodeChef PALPROB Palindromeness

Palindromeness Problem code: PALPROBTweetALL SUBMISSIONSAll submissions for this problem are available.Read problems statements

2016-04-18 20:00:38 563

原创 HDU 4426 Palindromic Substring

DescriptionIn the kingdom of string, people like palindromic strings very much. They like only palindromic strings and dislike all other strings. There is a unified formula to calculate the score

2016-04-18 19:17:24 752

原创 URAL 2040 Palindromes and Super Abilities 2

DescriptionDima adds letters s1, …, sn one by one to the end of a word. After each letter, he asks Misha to tell him how many new palindrome substrings appeared when he added that letter. Two

2016-04-18 14:55:23 562

原创 FZU 2226 信心题

Problem Description给定一个含有n个数字的数列,每个数字都有一个值a[i](下标从1开始)。定义第i个数字和第j个数字间的距离dis(i,j)=abs(i-j)。接下来给出q个询问,每次询问一个区间[l,r],要求求出一对数字(i,j)(l Input题目包含多组数据每组数据第一行一个数n第二行n个数字,表示数列a第三行一个数字q,表示询问

2016-04-17 19:52:30 984

原创 HDU 5668 Circle

Problem Description    Satiya August is in charge of souls.    He finds n souls,and lets them become a circle.He ordered them to play Joseph Games.The souls will count off from the soul

2016-04-16 21:52:06 808 2

原创 HDU 5667 Sequence

Problem Description    Holion August will eat every thing he has found.    Now there are many foods,but he does not want to eat all of them at once,so he find a sequence.fn=⎧⎩⎨⎪⎪1,ab,a

2016-04-16 21:49:42 611

原创 HDU 5666 Segment

Problem Description    Silen August does not like to talk with others.She like to find some interesting problems.    Today she finds an interesting problem.She finds a segment x+y=q.The

2016-04-16 21:47:54 548

原创 HDU 5665 Lucky

Problem Description    Chaos August likes to study the lucky numbers.    For a set of numbers S,we set the minimum non-negative integer,which can't be gotten by adding the number in S,as t

2016-04-16 21:45:23 521

原创 Codeforces Gym 100543G Virus synthesis

从这里get的思路,膜拜一下#pragma comment(linker, "/STACK:102400000,102400000")#include#include#include#include#include#include#include#include#include#include#includeusing namespace std;typedef lo

2016-04-16 17:45:03 582

原创 HDU 5421 Victor and String

Problem DescriptionVictor loves to play with string. He thinks a string is charming as the string is a palindromic string.Victor wants to play n times. Each time he will do one of following

2016-04-16 11:56:07 756

原创 HDU 5157 Harry and magic string

Problem DescriptionHarry got a string T, he wanted to know the number of T’s disjoint palindrome substring pairs. A string is considered to be palindrome if and only if it reads the same backward

2016-04-15 21:25:15 529

原创 codeforces gym 100548G

求两个字符串的公共回文子串个数,搞两个回文树,dfs一遍即可。#pragma comment(linker, "/STACK:102400000,102400000")#include#include#include#include#include#include#include#include#include#include#includeusing namespac

2016-04-15 21:08:09 504

原创 FZU 2150 Fire Game

DescriptionFat brother and Maze are playing a kind of special (hentai) game on an N*M board (N rows, M columns). At the beginning, each grid of this board is consisting of grass or just empty and

2016-04-14 21:38:17 705

原创 FZU 2141 Sub-Bipartite Graph

DescriptionGiven a simple undirected graph G with n vertices and m edges, your task is to select a sub-bipartite graph of G with at least m/2 edges.In the mathematical field of graph theory, a

2016-04-14 21:35:44 736

原创 FZU 2140 Forever 0.5

DescriptionGiven an integer N, your task is to judge whether there exist N points in the plane such that satisfy the following conditions:1. The distance between any two points is no greater tha

2016-04-14 21:07:47 505

原创 HYSBZ 2160 拉拉队排练

Description艾利斯顿商学院篮球队要参加一年一度的市篮球比赛了。拉拉队是篮球比赛的一个看点,好的拉拉队往往能帮助球队增加士气,赢得最终的比赛。所以作为拉拉队队长的楚雨荨同学知道,帮助篮球队训练好拉拉队有多么的重要。拉拉队的选拔工作已经结束,在雨荨和校长的挑选下,n位集优秀的身材、舞技于一体的美女从众多报名的女生中脱颖而出。这些女生将随着篮球队的小伙子们一起,和对手抗衡,为艾利斯

2016-04-14 00:04:43 495

原创 HYSBZ 2565 最长双回文串

Description顺序和逆序读起来完全一样的串叫做回文串。比如acbca是回文串,而abc不是(abc的顺序为“abc”,逆序为“cba”,不相同)。输入长度为n的串S,求S的最长双回文子串T,即可将T分为两部分X,Y,(|X|,|Y|≥1)且X和Y都是回文串。Input一行由小写英文字母组成的字符串S。Output

2016-04-13 23:28:25 524

原创 HDU 5394 Trie in Tina Town

Problem DescriptionTina Town is a friendly place. People there care about each other.A trie which was planted by the first mayor of Tina Town grows in the center of the town.We define a pa

2016-04-13 21:50:43 813

原创 HYSBZ 3676 回文串

Description考虑一个只包含小写拉丁字母的字符串s。我们定义s的一个子串t的“出 现值”为t在s中的出现次数乘以t的长度。请你求出s的所有回文子串中的最 大出现值。 Input输入只有一行,为一个只包含小写字母(a -z)的非空字符串s。 Output输出一个整数,为逝查回文子串的最大出

2016-04-13 14:54:49 399

原创 HDU 5658 CA Loves Palindromic

Problem DescriptionCA loves strings, especially loves the palindrome strings.One day he gets a string, he wants to know how many palindromic substrings in the substring S[l,r].Attantion, each

2016-04-13 14:10:10 755

原创 URAL 1960 Palindromes and Super Abilities

DescriptionAfter solving seven problems on Timus Online Judge with a word “palindrome” in the problem name, Misha has got an unusual ability. Now, when he reads a word, he can mentally count the

2016-04-13 13:57:54 538

原创 ZOJ 3707 Calculate Prime S

DescriptionDefine S[n] as the number of subsets of {1, 2, ..., n} that contain no consecutive integers. For each S[n], if for all i (1 ≤ i n) gcd(S[i],S[n]) is 1, we call that S[n] as a Prime S.

2016-04-12 23:31:42 615

原创 ZOJ 3708 Density of Power Network

DescriptionThe vast power system is the most complicated man-made system and the greatest engineering innovation in the 20th century. The following diagram shows a typical 14 bus power system. In

2016-04-12 23:25:31 302

原创 ZOj 3929 Deque and Balls

There are n balls, where the i-th ball is labeled as pi. You are going to put n balls into a deque. In the i-th turn, you need to put the i-th ball to the deque. Each ball will be put to both ends o

2016-04-11 12:12:06 634

空空如也

空空如也

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

TA关注的人

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