原创 SGU-223 Little Kings

狀壓* https://vjudge.net/problem/SGU-223 #include<bits/stdc++.h> #define LL long long using namespace std; int n,K,num[1

原创 poj1151 掃描線

https://blog.csdn.net/riba2534/article/details/76851233

原创 P1607 [USACO09FEB]廟會班車Fair Shuttle廟會 [線段樹+貪心]

貪心:按照每組奶牛終點排序,貪心策略,能早下的先下 區間加法,區間查詢 #include<bits/stdc++.h> using namespace std; int n,k,C; struct Pep{ int s,t,c;

原创 網絡流

https://www.cnblogs.com/zsboy/archive/2013/01/27/2878810.html #include<iostream> #include<cstdio> #include<cstring> #in

原创 樹剖

#include<iostream> #include<cstdio> #define MAXN 1e7+5 using namespace std; int hd[MAXN]; struct node{ int frm,to,n

原创 noip 烏龜棋

滾動數組 //圖論?因爲只有四種顏色,因此,一個點連四條邊 //數據保證到達終點時剛好用光 MM 張爬行卡片。??這就比較麻煩了 //回憶之前做過的搜索題 //f[i][j],j表示已經用了幾張牌了 //表示每張牌還有幾張f[][p][q