随笔分类 -  ACM模拟问题

POJ-2420 A Star not a Tree? 梯度下降 | 模拟退火
摘要:题目链接: 题意 给出n个点,找一个点,使得这个点到其余所有点距离之和最小。 思路 一开始就在抖机灵考虑梯度下降,猜测是个凸优化问题,完全在抖机灵。 最后实在是没得其他思路了,看了看题解。 居然是模拟退火,而且写的貌似没有随机这个因素,完全是爬山法好吧? 梯度下降,复杂度O(60000n) 提交过程 阅读全文

posted @ 2018-08-09 19:07 糖栗子 阅读(606) 评论(0) 推荐(0)

AtCoderBeginner091-C 2D Plane 2N Points 模拟问题
摘要:题目链接: 题意 On a two dimensional plane, there are N red points and N blue points. The coordinates of the i th red point are (ai,bi), and the coordinates 阅读全文

posted @ 2018-03-18 11:27 糖栗子 阅读(252) 评论(0) 推荐(0)

HDU-1225 Football Score 模拟问题(水题)
摘要:题目链接: 水题 代码 cpp include include include include using namespace std; struct Team{ int score[3]; string name; Team(string name="", int s1=0, int s2=0, 阅读全文

posted @ 2018-02-06 21:15 糖栗子 阅读(269) 评论(0) 推荐(0)

HDU-1035 Robot Motion 模拟问题(水题)
摘要:题目链接: 水题 代码 cpp include include int height, width, sp, dir[4][2]={1, 0, 0, 1, 1, 0, 0, 1}; std::map todir; char map[15][15]; int solve(int x, int y, i 阅读全文

posted @ 2018-02-06 21:13 糖栗子 阅读(140) 评论(0) 推荐(0)

HDU-1034 Candy Sharing Game 模拟问题(水题)
摘要:题目链接: 水题 代码 cpp include include int n; long long stu[10000+5], max, min; int func(void){ int tmp[2]={stu[0]/=2, 0}; for (int i=0; i 阅读全文

posted @ 2018-02-06 21:08 糖栗子 阅读(116) 评论(0) 推荐(0)

HDU-1032 The 3n+1 problem 模拟问题(水题)
摘要:题目链接: 水题 代码 cpp include include using namespace std; const int MAX=8388608; int num[MAX], a, b; int solve(int n){ if (n 阅读全文

posted @ 2018-02-06 21:01 糖栗子 阅读(124) 评论(0) 推荐(0)

导航