摘要: 通过条件约束模拟后续全状态+暴力枚举决定变量==不超时{或者说,一边边求解一边判断正误以减少不必要的运算}统一代码风格 1 #include 2 #include 3 #include 4 using namespace std; 5 int f[4][2]={{0,-1},{0,1},{-1,0}}; 6 const int maxn=20; 7 int ans; 8 int addcha; 9 int cnt=0;10 int a[maxn][maxn];11 bool check(int n)12 {13 int aa[maxn][maxn];14 for(int i=0... 阅读全文
posted @ 2013-09-27 17:34 little_w 阅读(267) 评论(0) 推荐(0)
摘要: 思维题区间内点的移动(形象)保持原有顺序+重新排序后记录初始位置(容易思路不清)+想象等效模型 1 #include 2 #include 3 #include 4 #include 5 #define maxn 10000+10 6 using namespace std; 7 struct ant 8 { 9 int ord;//记录原始位置10 int f;//-1 : L , 1 : R11 int p;12 bool operator l)55 {56 printf("Fell o... 阅读全文
posted @ 2013-09-27 17:30 little_w 阅读(275) 评论(0) 推荐(0)
摘要: 枚举例子+归纳推理数轴处理曲线+固定点(将同一个点放在数轴首尾)#include#include#include#include#define eps 0.000001#define maxn 2020double a[maxn];double b[maxn];using namespace std;double abss(double n){ if (n>=0) return n;else return -n;}int main(){ int n,m; while(~scanf("%d%d",&n,&m)) { double k1=1/(n+0.0) 阅读全文
posted @ 2013-09-27 10:58 little_w 阅读(285) 评论(0) 推荐(0)