原创 線段樹的區間更新

看了一上午線段樹的區間更新,總算有點眉目了。這裏放幾篇文章的鏈接,感覺講得是很好的: http://blog.csdn.net/sdjzping/article/details/19542103 http://blog.csdn.net/

原创 lightoj 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 an

原创 codeforce 796C Bank Hacking 智力題orz

題目: There are n banks, numbered from 1 to n. There are also n - 1 wires connecting the banks. All banks are initial

原创 Codeforces Round #415 (Div. 2) C. Do you want a date? 數學

題目: C. Do you want a date? time limit per test 2 seconds memory limit per test 256 megabytes input standar

原创 codeforce #401 div2 Alyona and Spreadsheet 思維題

題目: C. Alyona and Spreadsheet time limit per test 1 second memory limit per test 256 megabytes input stand

原创 lightoj 1027 A Dangerous Maze 期望,玄學

題目: You are in a maze; seeing n doors in front of you in beginning. You can choose any door you like. The probability

原创 圖論500題

轉載出處:http://blog.csdn.net/ffq5050139/article/details/7832991 =============================以下是最小生成樹+並查集===============

原创 codforces Codeforces Round #409 div2 C 二分搜索

題目: C. Voltage Keepsake time limit per test 2 seconds memory limit per test 256 megabytes input standard input

原创 spoj Ada and Queue 模擬+deque

題目鏈接:http://www.spoj.com/problems/ADAQUEUE/ 題意:就是讓你模擬一個雙端隊列的front(),back(),push_back(),push_front(),reverse這些功能。 分析:這題,

原创 Educational Codeforces Round 20 C 數學

題目: C. Maximal GCD time limit per test 1 second memory limit per test 256 megabytes input standard input outp

原创 一些常用數據結構的數組實現 不定期更新

循環隊列: 題目鏈接:cf 792B  分析:這個題就是約瑟夫環的變形,考慮到n比較小,可以用隊列模擬。 code: #include<cstdio> const int MAXN=100+5; int Q[MAXN]; int a[MA

原创 codeforce D. Innokenty and a Football League 貪心,模擬

題目: Innokenty is a president of a new football league in Byteland. The first task he should do is to assign short na

原创 lightoj1095 Arrange the Numbers 組合數學

題目: Consider this sequence {1, 2, 3 ... N}, as an initial sequence of first N natural numbers. You can rearrange this s

原创 codeforce771B Bear and Different Names 貪心or思維

題目: B. Bear and Different Names time limit per test 1 second memory limit per test 256 megabytes input standard

原创 Codeforces Round #400 Molly's Chemicals 前綴和

題目: C. Molly's Chemicals time limit per test 2.5 seconds memory limit per test 512 megabytes input standard inp