原创 XVII Open Cup named after E.V. Pankratiev. Grand Prix of SPb D cutting potatoes
一堆數,最多能分n次,求分後最大值除以最小值的 最小值 #include <cstdio> #include <cstring> #include <algorithm> #include <cmath> #include <map
原创 card sorting
對紙牌正反排序 暴力 , 狀壓 #include <bits/stdc++.h> using namespace std; int nu[200] , co[200] , best[200]; int term[4] ; bool
原创 Nubulsa Expo. 全局最小割
#include <bits/stdc++.h> //點標從0-n-1, 開始時先init 複雜度n^3 //對於邊(u,v,flow): //g[u][v]+=flow; //g[v][u]+=flow; typedef long l
原创 Highest Tower
矩形轉圖論 講道理我覺的我寫的第一段代碼能a,但是給的數據中包含使矩形不同的邊長數(頂點數)比矩形數(邊數)大超過1的情況,百思不得解.. #include <bits/stdc++.h> using namespace std;
原创 Construction sets 二分+揹包
XVII Open Cup named after E.V. Pankratiev. XXI Ural Championship 二分 用bitset處理揹包 #include <bits/stdc++.h> using
原创 new collections
交互題 無話可說...... #include <bits/stdc++.h> using namespace std ; set < string> s ; double magic[7]={10.0,100.0,999.96,
原创 hdu 5934 強連通 && 判斷覆蓋圖的最少點
bomb a 能觸發 b 則加一條a 到b 的邊。 用強連通縮點 處理DAG中每個點的最小代價。 覆蓋圖:所有出度爲0的點必須要被覆蓋,所有出度不爲0的點均可由其他點覆蓋。 所以 : 只要所有出度爲0的點, 就可以實現圖的覆蓋。 #
原创 Invertible tree 線段樹 + dfs 序
#include <cstdio> #include <climits> #include <algorithm> #include <iostream> #include <cstring> using namespace std;
原创 hdu 1569 最小割
給條件加邊流量爲inf,最小割求解 #include<stdio.h> #include<string.h> #include<queue> using namespace std; typedef long long ll ; #de
原创 Craters 計算幾何
面積最大的三角形一定在定點的凸包上,然後枚舉頂點 注意longlong #include <bits/stdc++.h> using namespace std ; #define maxn 200010 typedef long
原创 hdu 3657 game 最小割
#include<stdio.h> #include<string.h> #include<queue> using namespace std; typedef long long ll ; #define captype int
原创 dinner party dp 暴力
dp用bitset處理 讀取時注意判斷 #include <bits/stdc++.h> using namespace std ; typedef long long ll ; /*bitset<32> bitvec2(0
原创 hdu 3820 最小割
#include<stdio.h> #include<string.h> #include<queue> using namespace std; typedef long long ll ; #define captype int
原创 南陽理工oj 746 整數劃分(四) 區間dp
http://acm.nyist.net/JudgeOnline/problem.php?pid=746 區間dp #include <bits/stdc++.h> using namespace std ; typedef l
原创 tree standings 樹 && dp
#include <bits/stdc++.h> using namespace std ; #define MAXN 200 #define MOD 1000000007 typedef enum { NO_STANDS