原创 HDU 5187 zhx's contest (高精度快速冪)

Problem Description As one of the most powerful brushes, zhx is required to give his juniors n problems. zhx thinks the

原创 HDU 3265 Posters

Problem Description Ted has a new house with a huge window. In this big summer, Ted decides to decorate the window with

原创 Codeforces 1029C Maximal Intersection

You are given n segments on a number line; each endpoint of every segment has integer coordinates. Some segments can de

原创 牛客練習賽25 C 再編號

題目描述 n 個人,每個人有一個編號 ai 。 定義對 a 的再編號爲 a' ,滿足 。 現在有 m 次詢問,每次給定 x,t ,表示詢問經過 t 次再編號後第 x 個人的編號。 由於答案可能很大,所以對 109+7 取模。 輸入描述:

原创 Codeforces 1009D Relatively Prime Graph

Let's call an undirected graph G=(V,E) relatively prime if and only if for each edge (v,u)∈E  GCD(v,u)=1 (the greatest

原创 Hoj 1042 I-KeyBoard

Problem Description Most of you have probably tried to type an SMS message on the keypad of a cellular phone. It is som

原创 Codeforces 1005F Berland and the Shortest Paths

There are n cities in Berland. Some pairs of cities are connected by roads. All roads are bidirectional. Each road conn

原创 Wannafly summer camp Day2 L New Game!

題目描述: Eagle Jump公司正在開發一款新的遊戲。瀧本一二三作爲其員工,獲得了提前試玩的機會。現在她正在試圖通過一個迷宮。 這個迷宮有一些特點。爲了方便描述,我們對這個迷宮建立平面直角座標系。迷宮中有兩條平行直線 L1:Ax+By

原创 區間DP BZOJ 3229石子合併

Description   在一個操場上擺放着一排N堆石子。現要將石子有次序地合併成一堆。規定每次只能選相鄰的2堆石子合併成新的一堆,並將新的一堆石子數記爲該次合併的得分。   試設計一個算法,計算出將N堆石子合併成一堆的最小得分. In

原创 ZOJ 3593 One Person Game (乘法逆元)

There is an interesting and simple one person game. Suppose there is a number axis under your feet. You are at point A

原创 Codeforces 1006E Military Problem

In this problem you will have to help Berland army with organizing their command delivery system. There are n officers

原创 牛客小白月賽6 J 洋灰三角

題目描述     洋灰是一種建築材料,常用來築橋搭建高層建築,又稱,水泥、混凝土。     WHZ有很多鑄造成三角形的洋灰塊,他想把這些洋灰三角按照一定的規律放到擺成一排的n個格子裏,其中第i個格子放入的洋灰三角數量是前一個格子的k倍再多

原创 Poj 1704 Georgia and Bob

Description Georgia and Bob decide to play a self-invented game. They draw a row of grids on paper, number the grids fr

原创 Codefrces 1017C. The Phone Number

Mrs. Smith is trying to contact her husband, John Smith, but she forgot the secret phone number! The only thing Mrs. Sm

原创 Codeforces 1016C Vasya And The Mushrooms

Vasya's house is situated in a forest, and there is a mushroom glade near it. The glade consists of two rows, each of w