原创 Eclipse如何關聯源碼以及v4包關聯源碼
一、Eclipse關聯源碼 1、在項目右擊選擇Properites 2、如圖下選擇: 3、按下編輯之後會出現下圖所示的界面 4、重啓Eclipse,就成功導入了源碼二、關聯v4包源碼1、在libs目錄下創建File,命名爲a
原创 codeforces 253B - Physics Practical
B. Physics Practical time limit per test 1 second memory limit per test 256 megabytes input input.txt output o
原创 HDU 2289 Cup
二分法 #include<iostream> #include<cstdio> #include<cmath> #define PI acos(-1.0) using namespace std
原创 poj 1082
/* 月數和天數相加爲偶數時,frist取必勝,反之必敗; 特殊情況:9月30日和11月30日的時候, 9月只有30天,9月30號由10月1號(必敗)和10月30號(必勝)決定,爲必勝。 與上述結論矛盾,但9月29號爲必勝,9月後面的日子
原创 codefroces A. Cut Ribbon
#include<iostream> #define max(a,b) a>b?a:b #define INF 0xfffff using namespace std; int dp[4010]; int main() { int n
原创 codefroces B.Burning Midnight Oil
二分 #include<iostream> #include<cstdio> #include<algorithm> #include<queue> #include<cmath> using namespace std; int n,k
原创 Android Studio中Java lib控制檯輸出中文亂碼問題
在JavaLib下的build.gradle中加上代碼: tasks.withType(JavaCompile) { options.encoding = "UTF-8" }
原创 HDU 1142 A Walk Through the Forest
記憶化搜索+dfs #include<iostream> #include<cstdio> #include<cstring> #include<queue> using namespace std; int n,m; int dir
原创 HDU 4544 湫湫系列故事——消滅兔子(優先隊列+貪心)
優先隊列的應用, 定義優先隊列: struct node { int d,p; friend bool operator<(node x,node y) //優先隊列 { return x
原创 C++ STL next_permutation
/*next_permutation()返回的是布爾類型*/ #include<iostream> #include<algorithm> #include<string> using namespace std; int main(
原创 poj 2348 Euclid's Game
題目大意:有兩個人玩遊戲,比如有兩個堆石頭,一個人只能在多的那堆石頭裏取,並且只能取少的那堆石頭裏整數倍的石頭。給出兩堆石頭的數量,兩人輪流取,誰先取完其中一堆石頭則勝利,並且stan先取,要給出勝利人的名字 解題思路:假設一個這樣的狀態
原创 HDU 1114 Piggy-Bank
完全揹包問題 dp[j]=min(dp[j-w[i]]+p[i],dp[j]); dp[j-w[i]]+p[i]表示放進重量爲w[i],價值爲p[i]的物品,dp[j]表示不放此物品。 #include <iostream> #in
原创 HDU 2616 Kill the monster
代碼dfs: #include<iostream> #include<cstdio> using namespace std; int n,m; int ans; struct node { int ai,mi; }; node
原创 HDU 1428 校園漫步
最短路徑+記憶化搜索 #include<iostream> #include<cstdio> #include<cstring> #include<queue> using namespace std; const int INF=0x
原创 HDU 1233 還是暢通工程
#include <iostream> #include <cstdio> #define INF 0x7ffffff using namespace std; int map[105][105]; int n; int sum; vo