- 博客(5)
- 资源 (1)
- 收藏
- 关注
原创 HDU 1003 Max Sum
//简单DP,状态转移方程:dp[i] = max( a[i], a[i]+dp[i-1] ) #include #include #include using namespace std; int a[100005]; int main() { int t, n, cnt=0; cin >> t; while (t--) { cin >>
2013-06-17 19:39:58 547
原创 HDU 1010 Tempter of the Bone
#include #include #include using namespace std; char map[9][9]; int n, m, t, di, dj; int dir[4][2] = {{0,-1}, {0, 1}, {1, 0}, {-1, 0}};//四个方向 bool escape; void dfs(int si, int sj, int cnt) {
2013-06-16 20:17:32 552
原创 HDU 2072 单词数
#include #include #include #include //使用stringstream需要用到的头文件 using namespace std; string str; set article; //set中不会有重复的元素 int main() { while (getline(cin, str) && str != "#") //getline(ci
2013-06-16 15:39:19 709
原创 HDU 2080 夹角有多大
//好吧,水了。。。 #include #include #define PI 3.1415926 using namespace std; //返回值是弧度,需要转换成角度 double angle(double x1, double y1, double x2, double y2) { double dtheta,theta1,theta2; theta1 = atan
2013-06-16 14:34:25 612
原创 HDU 1016 Prime Ring Problem
#include #include #include using namespace std; int n, visited[20], res[20]; int isPrime(int x) { int i; if (x <= 1) return 0; for (i=2; i<=sqrt(x); i++) if
2013-06-15 12:50:27 454
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人