原创 POJ 2155 Matrix(二維樹狀數組)

Description Given an N*N matrix A, whose elements are either 0 or 1. A[i, j] means the number in the i-th row and j-th

原创 HDU 5446 Unknown Treasure(CRT+lucas定理)

Problem Description On the way to the next secret treasure hiding place, the mathematician discovered a cave unknown

原创 POJ 2773 Happy 2006(二分+容斥)

Description Two positive integers are said to be relatively prime to each other if the Great Common Divisor (GC

原创 HDU 3364 Lanterns(高斯消元)

Problem Description Alice has received a beautiful present from Bob. The present contains n lanterns and m switches.

原创 POJ 1743 Musical Theme(2.2 不可重疊最長重複子串)

Description A musical melody is represented as a sequence of N (1<=N<=20000)notes that are integers in the range 1..88

原创 hiho 166 逃離迷宮

描述 小Hi正處在由 N × M 個房間組成的矩陣迷宮中。爲了描述方便,我們把左上角的房間的座標定爲(0, 0),右下角房間的座標定爲(N-1, M-1)。每個房間可能是3種狀態之一:開放的、關閉的、或者上鎖的。 開放房間用'.'表示。

原创 CF 633B:A Trivial Problem

Mr. Santa asks all the great programmers of the world to solve a trivial problem. He gives them an integer m and asks

原创 樹型DP,樹上的揹包

遇到一個題目: 金礦問題 ★問題描述 有一個國家,所有的國民都非常老實憨厚,某天他們在自己的國家發現了 M 座金 礦,國王知道這個消息後非常高興,他希望能夠把這些金子都挖出來造福國民。後他找

原创 Caffe安裝過程一些Tips

Caffe安裝過程一些Tips 1.主要參考 1.CUDA 7.5+Caffe http://blog.csdn.net/g0m3e/article/details/51420565 2.Opencv 2.4.11 http://blog

原创 SCU 3082 windy's cake II(容斥)

Description rain_871 wants to make a cake for windy. Now she has a cake with size of 1*n grids. And she has m colors o

原创 CF630K:Indivisibility(容斥)

IT City company developing computer games decided to upgrade its way to reward its employees. Now it looks the f

原创 HDU 5465 Clarke and puzzle(二維樹狀數組)

Problem Description Clarke is a patient with multiple personality disorder. One day, Clarke split into two personalit

原创 Light OJ 1348 Aladdin and the Return Journey(樹剖-點)

Finally the Great Magical Lamp was in Aladdin's hand. Now he wanted to return home. But he didn't want to take any hel

原创 ZOJ 3908 Number Game(亂搞)

The bored Bob is playing a number game. In the beginning, there are n numbers. For each turn, Bob will take out two num

原创 CF 558E A Simple Task(多維線段樹)

This task is very simple. Given a string S of length n and q queries each query is on the format i j k which means