随笔分类 - OJ---HDU
摘要:Kelukin is a businessman. Every day, he travels around cities to do some business. On August 17th, in memory of a great man, citizens will read a book
阅读全文
摘要:One day, Kaitou Kiddo had stolen a priceless diamond ring. But detective Conan blocked Kiddo's path to escape from the museum. But Kiddo didn't want t
阅读全文
摘要:There are N schedules, the i-th schedule has start time s i si and end time e i ei (1 <= i <= N). There are some machines. Each two overlapping schedu
阅读全文
摘要:There is a nonnegative integer sequence a 1...n a1...n of length n n . HazelFan wants to do a type of transformation called prefix-XOR, which means a
阅读全文
摘要:Bob has a dictionary with N words in it. Now there is a list of words in which the middle part of the word has continuous letters disappeared. The mid
阅读全文
摘要:We define the distance of two strings A and B with same length n is dis A,B =∑ i=0 n−1 |A i −B n−1−i | disA,B=∑i=0n−1|Ai−Bn−1−i| The difference betwee
阅读全文
摘要:Give an array A, the index starts from 1. Now we want to know B i =max i∤j A j Bi=maxi∤jAj , i≥2 i≥2 . InputThe first line of the input gives the numb
阅读全文
摘要:Little Ruins is playing a number game, first he chooses two positive integers yy and KK and calculates f(y,K)f(y,K), here f(y,K)=∑z in every digits of
阅读全文
摘要:Nim is a mathematical game of strategy in which two players take turns removing objects from distinct heaps. On each turn, a player must remove at lea
阅读全文
摘要:One day Silence is interested in revolving the digits of a positive integer. In the revolving operation, he can put several last digits to the front o
阅读全文
摘要: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 strin
阅读全文
摘要:Alice are given an array A[1..N]A[1..N] with NN numbers. Now Alice want to build an array BB by a parameter KK as following rules: Initially, the arra
阅读全文
摘要:Bob intends to color the nodes of a tree with a pen. The tree consists of NN nodes. These nodes are numbered 1,2,...,N1,2,...,N. The root of the tree
阅读全文
摘要:Alice is interesting in computation geometry problem recently. She found a interesting problem and solved it easily. Now she will give this problem to
阅读全文
摘要:There is a sequence aa of length nn. We use aiai to denote the ii-th element in this sequence. You should do the following three types of operations t
阅读全文
摘要:On Saint Valentine's Day, Alex imagined to present a special pendant to his girl friend made by K kind of pearls. The pendant is actually a string of
阅读全文
摘要:Perhaps the sea‘s definition of a shell is the pearl. However, in my view, a shell necklace with n beautiful shells contains the most sincere feeling
阅读全文
摘要:度度熊参与了喵哈哈村的商业大会,但是这次商业大会遇到了一个难题: 喵哈哈村以及周围的村庄可以看做是一共由n个片区,m条公路组成的地区。 由于生产能力的区别,第i个片区能够花费a[i]元生产1个商品,但是最多生产b[i]个。 同样的,由于每个片区的购买能力的区别,第i个片区也能够以c[i]的价格出售最
阅读全文
摘要:都是取的模板,这几天做的素数题挺多的,所以整理了放在这里,感觉有一天回用到的! SPOJ:Nth Prime: 求第N个素数,N<1e9。 #include<bits/stdc++.h> using namespace std; typedef long long ll; const int N=2
阅读全文
摘要:Zeus 和 Prometheus 做了一个游戏,Prometheus 给 Zeus 一个集合,集合中包含了N个正整数,随后 Prometheus 将向 Zeus 发起M次询问,每次询问中包含一个正整数 S ,之后 Zeus 需要在集合当中找出一个正整数 K ,使得 K 与 S 的异或结果最大。Pr
阅读全文