![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
lightoj
SSimpLe_Y
人一我百,人十我万,然而我做不到。
展开
-
lightoj 1269 - Consecutive Sum(字典树)
Little Jimmy is learning how to add integers. As in decimal the digits are 0 to 9, it makes a bit hard for him to understand the summation of all pair of digits. Since addition of numbers requires the原创 2017-03-12 15:21:01 · 1328 阅读 · 0 评论 -
lightoj 1234 - Harmonic Number(技巧打表)
In mathematics, the nth harmonic number is the sum of the reciprocals of the first n natural numbers:In this problem, you are given n, you have to find Hn.InputInput starts with an integer T原创 2017-02-26 14:37:03 · 1040 阅读 · 0 评论 -
lightoj 1101 - A Secret Mission(MST上的树链剖分)
All of you have heard about Evil Jack Diablo, the one who had stolen the whole problem set from the Good Judges last time. Once again he is making evil plans, but he does not know that Alice is on a s原创 2017-01-15 23:06:50 · 954 阅读 · 0 评论 -
lightoj 1146 - Closest Distance(三分)
Two men are moving concurrently, one man is moving from A to B and other man is moving from C to D. Initially the first man is at A, and the second man is at C. They maintain constant velocities suc原创 2017-01-29 16:11:58 · 954 阅读 · 0 评论 -
lightoj 1135 - Count the Multiples of 3(线段树)
You have an array with n elements which is indexed from 0 to n - 1. Initially all elements are zero. Now you have to deal with two types of operations1. Increase the numbers between indices i a原创 2017-01-28 17:52:32 · 849 阅读 · 0 评论 -
lightoj 1246 - Colorful Board
You are given a rectangular board. You are asked to draw M horizontal lines and N vertical lines in that board, so that the whole board will be divided into (M+1) x (N+1) cells. So, there will be M+1r原创 2016-10-14 20:43:15 · 829 阅读 · 0 评论 -
lightoj 1102 - Problem Makes Problem(组合数+逆元)
As I am fond of making easier problems, I discovered a problem. Actually, the problem is 'how can you make n by adding k non-negative integers?' I think a small example will make things clear. Suppose原创 2017-01-16 17:55:51 · 785 阅读 · 0 评论 -
lightoj 1117 - Helping Cicada(容斥)
Cicada is an insect with large transparent eyes and well-veined wings similar to the "jar flies". The insects are thought to have evolved 1.8 million years ago during the Pleistocene epoch. There are原创 2017-01-14 20:58:49 · 898 阅读 · 0 评论 -
lightoj 1009 - Back to Underworld(二分图染色)
The Vampires and Lykans are fighting each other to death. The war has become so fierce that, none knows who will win. The humans want to know who will survive finally. But humans are afraid of going t原创 2017-01-14 14:18:23 · 831 阅读 · 0 评论 -
lightoj 1080 - Binary Simulation(树状数组)
Given a binary number, we are about to do some operations on the number. Two types of operations can be here.'I i j' which means invert the bit from i to j (inclusive)'Q i' answer whether th原创 2016-11-05 09:25:37 · 753 阅读 · 0 评论 -
lightoj 1081 - Square Queries(二维RMQ)
Little Tommy is playing a game. The game is played on a 2D N x N grid. There is an integer in each cell of the grid. The rows and columns are numbered from 1 to N.At first the board is shown. When t原创 2016-11-05 09:56:54 · 680 阅读 · 0 评论 -
lightoj 1094 - Farthest Nodes in a Tree(树的直径)
Given a tree (a connected graph with no cycles), you have to find the farthest nodes in the tree. The edges of the tree are weighted and undirected. That means you have to find two nodes in the tre...原创 2017-03-07 15:18:45 · 673 阅读 · 0 评论 -
lightoj 1257 - Farthest Nodes in a Tree (II)(树的直径升级版)
Given a tree (a connected graph with no cycles), you have to find the cost to go to the farthest node from each node. The edges of the tree are weighted and undirected.InputInput starts with an in原创 2017-03-07 16:25:00 · 804 阅读 · 0 评论 -
lightoj 1341 - Aladdin and the Flying Carpet / lightoj 1236 - Pairs Forming LCM(算术基本定理)
1341 - Aladdin and the Flying CarpetIt's said that Aladdin had to solve seven mysteries before getting the Magical Lamp which summons a powerful Genie. Here we are concerned about the first myster原创 2017-03-18 17:22:38 · 839 阅读 · 0 评论 -
lightoj 1336 - Sigma Function(算数基本定理)
Sigma function is an interesting function in Number Theory. It is denoted by the Greek letter Sigma (σ). This function actually denotes the sum of all divisors of a number. For example σ(24) = 1+2+3+4原创 2017-06-27 17:04:47 · 1303 阅读 · 0 评论 -
lightoj 1370 - Bi-shoe and Phi-shoe(欧拉函数)
Bamboo Pole-vault is a massively popular sport in Xzhiland. And Master Phi-shoe is a very popular coach for his success. He needs some bamboos for his students, so he asked his assistant Bi-Shoe to go原创 2017-06-26 17:56:22 · 783 阅读 · 0 评论 -
lightoj 1220 - Mysterious Bacteria(算数基本定理)
Dr. Mob has just discovered a Deathly Bacteria. He named it RC-01. RC-01 has a very strange reproduction system. RC-01 lives exactly x days. Now RC-01 produces exactly p new deadly Bacteria where x =原创 2017-07-01 15:13:04 · 843 阅读 · 0 评论 -
lightoj 1282 - Leading and Trailing
You are given two integers: n and k, your task is to find the most significant three digits, and least significant three digits of nk.InputInput starts with an integer T (≤ 1000), denoting the num原创 2017-06-30 20:14:53 · 1318 阅读 · 0 评论 -
lightoj 1138 - Trailing Zeroes (III)(N的阶层后有多少个零+二分)
You task is to find minimal natural number N, so that N! contains exactly Q zeroes on the trail in decimal notation. As you know N! = 1*2*...*N. For example, 5! = 120, 120 contains one zero on the t原创 2017-06-29 19:08:42 · 879 阅读 · 0 评论 -
lightoj 1063 - Ant Hills(强连通求割点)
After many years of peace, an ant-war has broken out.In the days leading up to the outbreak of war, the ant government devoted a great deal of resources toward gathering intelligence on ant hills. I原创 2016-10-27 22:34:32 · 1074 阅读 · 0 评论 -
lightoj 1205 - Palindromic Numbers(数位DP)
A palindromic number or numeral palindrome is a 'symmetrical' number like 16461 that remains the same when its digits are reversed. In this problem you will be given two integers i j, you have to find原创 2017-05-01 16:09:27 · 933 阅读 · 0 评论 -
lightoj 1071 - Baker Vai(双线DP)
All of you must have heard the name of Baker Vai. Yes, he rides a bike and likes to help people. That's why he is popular amongst general people.Baker Vai lives in a city which can be modeled as a 2原创 2016-09-13 13:51:34 · 933 阅读 · 0 评论 -
lightoj 1424 - New Land(单调栈)
Once upon a time there lived an old wise king. He had only one son. The prince had the idea that he (the prince) was about to be the future king; that's why he became too lazy day by day. This made th原创 2017-04-07 17:06:57 · 1169 阅读 · 0 评论 -
lightoj 1108 - Instant View of Big Bang(SPFA负环)
Have you forgotten about wormholes? Oh my god! Ok, let me explain again.A wormhole is a subspace tunnel through space and time connecting two star systems. Wormholes have a few peculiar properties:原创 2016-11-10 17:58:23 · 784 阅读 · 0 评论 -
lightoj 1066 - Gathering Food
Winter is approaching! The weather is getting colder and days are becoming shorter. The animals take different measures to adjust themselves during this season.- Some of them "migrate." This means t原创 2016-10-29 09:41:27 · 746 阅读 · 0 评论 -
lightoj 1037 - Agent 47
Agent 47 is in a dangerous Mission "Black Monster Defeat - 15". It is a secret mission and so 47 has a limited supply of weapons. As a matter of fact he has only one weapon the old weak "KM .45 Tactic原创 2016-09-06 19:06:06 · 844 阅读 · 0 评论 -
lightoj 1021 - Painful Bases
As you know that sometimes base conversion is a painful task. But still there are interesting facts in bases.For convenience let's assume that we are dealing with the bases from 2 to 16. The valid s原创 2016-09-05 17:51:45 · 985 阅读 · 0 评论 -
lightoj 1140 - How Many Zeroes?(数位DP)
Jimmy writes down the decimal representations of all natural numbers between and including m and n, (m ≤ n). How many zeroes will he write down?InputInput starts with an integer T (≤ 11000), denot原创 2016-09-16 12:51:23 · 788 阅读 · 0 评论 -
lightoj 1134 - Be Efficient
You are given an array with N integers, and another integer M. You have to find the number of consecutive subsequences which are divisible by M.For example, let N = 4, the array contains {2, 1, 4, 3原创 2016-09-16 10:25:38 · 726 阅读 · 0 评论 -
lightoj 1126 - Building Twin Towers
Professor Sofdor Ali is fascinated about twin towers. So, in this problem you are working as his assistant, and you have to help him making a large twin towers.For this reason he gave you some recta原创 2016-09-15 12:48:56 · 903 阅读 · 0 评论 -
lightoj 1125 - Divisible Group Sums
Given a list of N numbers you will be allowed to choose any M of them. So you can choose in NCM ways. You will have to determine how many of these chosen groups have a sum, which is divisible byD.原创 2016-09-15 11:47:21 · 698 阅读 · 0 评论 -
lightoj 1110 - An Easy LCS (LCS输出路径)
LCS means 'Longest Common Subsequence' that means two non-empty strings are given; you have to find the Longest Common Subsequence between them. Since there can be many solutions, you have to print th原创 2016-09-14 13:03:32 · 812 阅读 · 0 评论 -
lightoj 1084 - Winter
Winter is coming. In a land far away, N men are spending the nights in a valley in a largest field. The valley is so narrow that it can be considered to be a straight line running east-to-west.Altho原创 2016-09-13 17:03:40 · 806 阅读 · 0 评论 -
lightoj 1079 - Just another Robbery(01背包)
As Harry Potter series is over, Harry has no job. Since he wants to make quick money, (he wants everything quick!) so he decided to rob banks. He wants to make a calculated risk, and grab as much mone原创 2016-09-13 14:39:16 · 902 阅读 · 0 评论 -
lightoj 1064 - Throwing Dice
n common cubic dice are thrown. What is the probability that the sum of all thrown dice is at least x?InputInput starts with an integer T (≤ 200), denoting the number of test cases.Each test cas原创 2016-09-09 16:52:29 · 896 阅读 · 0 评论 -
lightoj 1145 - Dice (I)
You have N dices; each of them has K faces numbered from 1 to K. Now you have arranged the N dices in a line. You can rotate/flip any dice if you want. How many ways you can set the top faces such t原创 2016-09-19 20:36:52 · 731 阅读 · 0 评论 -
lightoj 1044 - Palindrome Partitioning
A palindrome partition is the partitioning of a string such that each separate substring is a palindrome.For example, the string "ABACABA" could be partitioned in several different ways, such as {"A原创 2016-09-07 10:10:20 · 884 阅读 · 0 评论 -
1030 - Discovering Gold(概率DP?)
You are in a cave, a long cave! The cave can be represented by a 1 x N grid. Each cell of the cave can contain any amount of gold.Initially you are in position 1. Now each turn you throw a perfect 6原创 2016-10-05 21:00:23 · 897 阅读 · 0 评论 -
1422 - Halloween Costumes(区间DP)
Gappu has a very busy weekend ahead of him. Because, next weekend is Halloween, and he is planning to attend as many parties as he can. Since it's Halloween, these parties are all costume parties, Gap原创 2016-10-15 09:34:36 · 775 阅读 · 0 评论 -
lightoj 1090 - Trailing Zeroes (II)
Find the number of trailing zeroes for the following function:nCr * pqwhere n, r, p, q are given. For example, if n = 10, r = 4, p = 1, q = 1, then the number is 210 so, number of trailing zeroes原创 2016-11-05 11:28:08 · 709 阅读 · 0 评论