原创 UVA 10615 Rooks(?)

這題是我碰到的二分圖最難,到現在都還沒明白怎麼回事,先存着吧。#include<iostream> #include<cstring> #inclu

原创 HDU 1754 I Hate It(線段樹單點更新)

#include<iostream> #include<algorithm> using namespace std; const int maxn=800000+5; int n,m,a[maxn/4]; struct Interval

原创 UVA 11294 Wedding(2-sat)

#include<iostream> #include<cstdio> #include<cstring> #include<algorithm> #include<vector> using namespace st

原创 UVA 10816 Traverl in Desert(最短路+二分)

這題精度卡了三天。#include<iostream> #include<queue> #include<cstring> #include<alg

原创 HDU 1166 敵兵佈陣(線段樹單點更新)

#include<iostream> using namespace std; const int maxn=200000+5; int n,a[maxn/4]; struct Intervaltree{ int val[maxn

原创 HDU 1213 How many table(dfs)

#include<iostream> using namespace std; const int maxn=1000+5; bool map[maxn][maxn],used[maxn]; int n,m; void dfs(int u

原创 HDU 1214 圓桌會議

#include<iostream> using namespace std; int main() { int n; while(~scanf("%d",&n)) { int ans=(n-n/2

原创 HDU 1701 ACMer

這題意太蛋疼了,要求人數最少,那麼x從1枚舉,人數最少也就是說ACMer數也是最少。#include<iostream> using namespa

原创 2016 ACM/ICPC Asia Regional Qingdao Online 青島賽區(已完成8題)

1001   <pre name="code" class="cpp">#include <iostream>   #include <cstdio>   #define min(a,b) ((a)<(b)?(a):(b))   #de

原创 HDU 1210 Eddy's 洗牌問題(找規律)

#include<iostream> using namespace std; int main() { int n; while(~scanf("%d",&n)) { int i=2,step=0

原创 HDU 1215 七夕節(打表)

這題一開始想用唯一分解定理做,蠢哭。#include<iostream> using namespace std; const int maxn=5

原创 HDU 1212 Big Number

#include<iostream> #include<string> using namespace std; int main() { string a;int b; while(cin>>a>>b) {

原创 UVA 1494 Qin Shi Huang's National Road System(次小生成樹+Prim)

#include<iostream> #include<cstring> #include<algorithm> #include<cmath> #include<vector> #include<queue> using namespa

原创 POJ Treasure Exploration(DAG最小可相交路徑覆蓋)

這題一開始題目沒看清,一般的最小路徑覆蓋是不能有重點的,但是這題目有一句You should notice that the roads of two different robots may conta

原创 HDU 1717 小數化分數2

思路來源:點擊打開鏈接 #include<iostream> #include<cmath> #include<string> using namespace std; int gcd(int a,int b){ return b