原创 2016.11.14打卡 距NOIP5天

最近還是天天頹廢啊。。。 做了幾套題。。。。上不了100。。。。。。好差勁啊。。。。和別人差遠了。。。。。 今天做了一套題,第一題CE【手動白眼】,爆零,第二題60,第三題一看多組數據啊我連暴力都不會打【手動白眼】,就棄療了,其

原创 【Poj2392 Space Elevator】多重揹包

#include <cstdio> #include <cstring> #include <algorithm> using namespace std; const int MAXN = 400000 + 5; struc

原创 【codevs1031 質數環】回溯法

#include <cstdio> #include <cmath> #include <cstring> int A[50], n; bool vis[50], isp[50]; bool is_prime(int i) {

原创 【Uva12096】map + vector + 棧

題目鏈接 解題思路 用map給每個集合分配一個編號,剛好利用了map裏的元素不允許重複和count函數可以查詢某個元素有沒有出現過。用vector把集合存起來,通過編號可以在vector裏提取出相應的集合,在棧裏操作編號就很方便。

原创 【Poj1088 滑雪】記憶化搜索

#include <cstdio> #include <cstring> #include <algorithm> using namespace std; const int MAXN = 105; int a[MAXN][M

原创 【POJ 2396】有源匯上下界可行流

1月14號的時候看Fancy學姐的博客學網絡流,寫的很好,很容易懂。然後就開始學有源匯上下界可行流,方法很簡單,就添一條t到s上下界爲0, INT_MAX的邊然後按無源匯上下界可行流的做就行了【但是具體爲什麼這樣可以我還不是很懂。

原创 【UVa455】週期串

#include <cstdio> #include <cstring> #include <iostream> #include <algorithm> #include <string> using namespace std

原创 【codevs1098 均分紙牌】貪心

#include <cstdio> #include <algorithm> using namespace std; int a[105]; int main() { int n, sum(0), ans(0);

原创 2016紀事

好快啊,轉眼2016年就要過完了。 我超喜歡2016年的其實,2016是4的倍數,念出來也圓圓的特別好聽。 2016年入了OI這個大坑,CSDN的ID也算是紀念吧。 大概是今年寒假過後不久,我纔開始學OI,學的太晚了,一開

原创 NOIP2016

11月18號早上還是七點到學校,坐在機房一起頹了一會兒。之前17號還挺傷感的,因爲會有一些人退役。。。。。 然後就上車,本來想再看看,但是頹了幾把狼人,都是我嘴賤把自己說死了,明明不會玩還非想說話(:з」∠)。 下午。。。。沒

原创 【codevs2194 N皇后(輸出方案)】回溯法

#include <cstdio> #include <algorithm> #include <cstring> using namespace std; int vis[3][100], n, tot = 0, C[100]

原创 【codevs1453 統計素數個數2】E氏篩法

#include <cstdio> #include <cstring> #include <cmath> bool isp[5000000 + 5]; int main() { int l, r; scanf

原创 生成1~n的排列的三種方法

#include <cstdio> #include <algorithm> const int MAXN = 10; bool used[MAXN + 1]; int n, a[MAXN + 1]; void search

原创 【codevs1295 N皇后問題(不輸出方案)】回溯法

#include <cstdio> #include <algorithm> #include <cstring> using namespace std; int n, C[15], tot = 0; void search

原创 2016.12.14 打卡 距NOI229天

恩,195,省二,到也就這個水平。一開始還有點出乎我的意料,但要是之前再少頹一點就好了,要是再多努力一點就好了,就不會現在天天因爲文化課發愁,機房想來但是要寫作業,就能夠一心一意做我想做的事情了。 但是還不晚吧,我今年肯定會去參加