原创 ZOJ 3107 Counting Squares//計算幾何

題意:按指令畫多邊形,求出裏面有多少個正方形。 思路:求出面積。注意:需判斷多邊形的走向,利用叉積的正負個數。 #include<iostream> #include<stdio.h> #include<math.h> #include<

原创 zoj 3230Solving the Problems//優先隊列

#include<iostream> #include<stdio.h> #include<string.h> #include<stdlib.h> #include<queue> using namespace std; #define

原创 zoj 3197 Google Book//最小區間覆蓋

最悲哀的,莫過於死活不過... #include<iostream> #include<stdio.h> #include<stdlib.h> #include<string.h> using namespace std; #define

原创 zoj3321Circle//迴路判斷

題目提示只有一條迴路。思路:並查集+出入度檢測。 #include<iostream> #include<stdio.h> #include<stdlib.h> #include<string.h> using namespace std

原创 zoj 3513 Human or Pig//

題意難讀懂。理解這句:豬隨意跳,人可以選擇。要確保跳河裏的時候,是豬就行。 #include<iostream> #include<stdio.h> using namespace std; int n,m; char s[51000];

原创 zoj3551 Bloodsucker//概率&dp

參考:http://raya.blogcn.com/articles/zoj-3551.html #include<iostream> #include<stdio.h> using namespace std; double dp[10

原创 pat 1496 數列區間//線段樹

題意:數列區間 思路:還算是簡單的線段樹操作,關鍵兩點:                1 ,更新過程;                 2,最後的數列標記,記住是最長連續區間長的。給組測試數據: 3 2   1 3 2 2  答案:1

原创 CSDN,我又回來啦

RT.     哈哈,近期考研複習ing,加油!期待繼續更新博客的那一刻! 點贊 收藏 分享 文章舉報 lazy_virus 發佈了306 篇原創文章 · 獲贊 7 · 訪問量

原创 zoj 3204 Connect them//最小生成樹

kru算法。 #include<iostream> #include<stdio.h> #include<string.h> #include<stdlib.h> using namespace std; int n,g[111][11

原创 hdu1466 計算直線的交點數//dp+set

#include<iostream> #include<stdio.h> #include<set> using namespace std; class node { public: set<int >t; }; node st[21

原创 zoj3123 Subsequence//最短序列和

毫無優化時,TLE, 加入二分優化,時間爲50ms.強大的二分 AC代碼: #include<stdio.h> #include<string.h> #include<iostream> using namespace std; #def

原创 hdu 1176免費餡餅 //dp

#include<iostream> #include<stdlib.h> #include<stdio.h> using namespace std; #define ma(x,y) ((x>y?x:y)) int dp[11][100

原创 創建Time 對象

創建2個Time對象,執行兩for循環,顯示時間延緩! Time類: //:C09:Cpptime.h //A simple time class #ifndef CPPTIME_H #define CPPTIME_H #include<

原创 zoj3519 Who is the Smartest Man//貪心

#include<iostream> #include<stdio.h> #include<string.h> #include<stdlib.h> using namespace std; int p[506]; int cc,n; i

原创 All Is over

Done ! 點贊 收藏 分享 文章舉