原创 HDU 1290 獻給杭電五十週年校慶的禮物

純粹的數學題,平面劃分空間, 要想每一平面劃分都得到最大值,就必須讓這一平面與所有平面相交, 劃分的塊的數量sum[n]: 2,4,8,15,26…… 前後的差a[n]: 2,4,7,11…… a[n]與a[n-1]兩者之差: 2,3,4

原创 HDU 2067 小兔的棋盤

打表就行了#include<iostream> #include<cstdio> using namespace std; int main() { int i,j,n; __int64 a[37][37]; fo

原创 HDU 1420 Prepared for New Acmer

蒙哥馬利算法 0ms #include<iostream> using namespace std; int main() { int m; __int64 a,b,c; cin>>m; while(m-

原创 HDU 1075 What Are You Talking About

用map做的, #include <iostream> #include <map> #include <string> #include <cctype> using namespace std; map<string ,string>

原创 HDU dp 2059 龜兔賽跑

每次前面所有情況都要考慮#include<iostream> #include<cstdio> #define MAX 1000000.0 using namespace std; int main() { int L;

原创 HDU 1429 勝利大逃亡(續)

學習到位壓縮,位壓縮還是很重要的,第一次做位壓縮的題目,感覺以前學習C語言位運算的時候,不太紮實啊! 開始的時候,dir數組中少加了一個逗號,調試了十多分鐘才發現,還是不夠仔細…… #include<iostream> #include<

原创 (DP)HDU 1080 Human Gene Functions

/*狀態轉移方程:dp[i][j]=max(dp[i-1][j]+w[s1[i]]['-'],dp[i][j-1]+w['-'][s2[j]],dp[i-1][j-1]+w[s1[i]][s2[j]]) dp[i-1][j]+w[s1[

原创 HDU 1405 The Last Practice

一直在格式錯誤,每個案例最後一個數後面還要空格,坑爹……T_T…… #include <iostream> using namespace std; bool isprime[65536]; int main() { int i,n,j

原创 HDU 1426 Sudoku Killer

dfs搜索的題目,還是不太會寫啊!參考了別人的代碼寫的。 #include<iostream> #include<cstring> #include<cstdio> using namespace std; int map[9][9];

原创 HDU 2056 Rectangles

第二次寫的代碼: #include<iostream> #include<algorithm> #include<cstdio> using namespace std; struct node { double x,y; }

原创 (DP) HDU 1227 Fast Food

/*dp[i][j]=min(dp[i][j],dp[k][j-1]+d[k+1][i]) dp[k][j-1] 表示從k個飯店中建立j-1個倉庫 d[k+1][i] 表示從第k+1個飯店到第i個飯店之間建立一個倉庫最短距

原创 (DP)HDU 1158 Employment Planning

#include<iostream> #include<cstdio> #define INF 10000000 using namespace std; int worker[100005]; int dp[13][100005]; i

原创 HDU dp 2571 命運

dp的題目,dp[i][j]=max(dp[i-1][j],dp[i][j-1],dp[i][j); #include<iostream> #include<cstring> #include<cstdio> #define INF -

原创 codeforces B. Restoration of the Permutation

#include<iostream> #include<cstdio> #include<cstring> using namespace std; bool flag[1005]; int a[1005],b[1005]; int ma

原创 Android 自定義TextView 自動換行

Android TextView默認是標點符號不能再行尾和行首,英文單詞不能拆分; 1、網上有說修改源碼(表示我是菜鳥)、也有說轉半角或全角(這種真的不太行啊,半角的話還是有點問題;全角的話英文就難看了,顯示出來只能呵呵~~。) 2、自