
模拟
xxx_bug
这个作者很懒,什么都没留下…
展开
-
ZOJ Problem Set - 1056 The Worm Turns
一道蠕虫模拟题~~很简单。考虑头和尾的变化即可。用map记录整个虫的形状,然后看看头是不是碰撞到虫身或墙壁。虫尾是跟着虫头走的。#include #include #include using namespace std;bool flag ;struct Node{ int x,y;};Node tail,head;bool map[50][50];void in原创 2011-10-22 14:28:01 · 416 阅读 · 0 评论 -
POJ 1002 487-3279
通过这道题发现了一些好玩的东东,顺便复习了很多东西!先贴下代码!这个代码几乎来自网络!还有一些人用排序二叉树,字典树,快排做!真是牛叉!#include #include #include #include #include using namespace std;priority_queue, greater >q;int t[10000000];int m原创 2012-01-27 22:09:57 · 705 阅读 · 0 评论