原创 hdu1033 Edge

http://acm.hdu.edu.cn/showproblem.php?pid=1033 A是右轉,V是左轉。。。。初始座標是300,420,每次走10。。。。。。模擬就可以了,四個走向 代碼: #include<stdio.h>

原创 SGU144

Description Two of the three members of the winning team of one of the ACM regional contests are going to meet in or

原创 POJ3253 Fence Repair

http://poj.org/problem?id=3253 大致題意: 有一個農夫要把一個木板鉅成幾塊給定長度的小木板,每次鋸都要收取一定費用,這個費用就是當前鋸的這個木版的長度 給定各個要求的小木板的長度,及小木板的個數n,求

原创 SGU130 Circle

130. Circle time limit per test: 0.25 sec.  memory limit per test: 4096 KB On a circle border there are 2k differe

原创 hdu1728 逃離迷宮

逃離迷宮 Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 14587   

原创 卡特蘭數

什麼是Catalan數 說到Catalan數,就不得不提及Catalan序列,Catalan序列是一個整數序列,其通項公式是我們從中取出的就叫做第n個Catalan數,前幾個Catalan數是:1, 1, 2, 5, 14, 42,

原创 POJ3233 Matrix Power Series

http://poj.org/problem?id=3233 這是我第一次做矩陣快速冪的題目。。。 有太多太多的不懂。。。 代碼: #include <cstdio> #include <iostream> #include <

原创 SGU 126 Boxes

126. Boxes time limit per test: 0.25 sec.  memory limit per test: 4096 KB There are two boxes. There are A balls

原创 樹狀數組模版

感覺。。。。。。。。。 樹狀數組 #include<iostream> #include<string.h> #include<string> #include<stdio.h> using namespace std; templa

原创 codeforces 416B

B. Art Union time limit per test 1 second memory limit per test 256 megabytes input standard input output

原创 hdu1012 u Calculate e

u Calculate e Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s):

原创 hdu2817 A sequence of numbers

A sequence of numbers Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submis

原创 POJ3070Fibonacci

http://poj.org/problem?id=3070 據說這是一道非常簡單的矩陣乘法題目,小孩子都會做。。 那我呢,思考了那麼久 二進制數有多少個1就代碼就執行多少次。 第一個代碼: #include <stdio.h> #inc

原创 hdu2103

Family planning Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(

原创 求矩陣的快速冪

原貼 http://blog.csdn.net/mark_meego/article/details/8654619題目描述: 給定一個n*n的矩陣,求該矩陣的k次冪,即P^k。 輸入: 輸入包含多組測試數據。 數據的第一行爲一個整數