随笔分类 -  模拟

hdu 4608 I-number
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=4608直接暴力代码:#include#include#include#include#include#include#include#include#include#include#include#include#include#include#include#includeusing namespace std;typedef long long ll;typedef unsigned int uint;const double eps=1e-12;const int INF=0x3f3f3f3f;cons 阅读全文
posted @ 2013-07-23 21:07 夜-> 阅读(180) 评论(0) 推荐(0) 编辑
E. Printer
摘要:http://codeforces.com/contest/253/problem/E对优先级进行二分 每次给一个优先级就模拟一下看是否合格 不合格就二分调整需要注意的地方 所给T的范围会超 int (就是这点敲代码时忽略了 wa 了很久 细节呀) 还有就是优先级没有重的情况代码:#include<iostream>#include<cstdio>#include<cstring>#include<string>#include<map>#include<vector>#include<stack>#inclu 阅读全文
posted @ 2012-12-11 19:28 夜-> 阅读(194) 评论(0) 推荐(0) 编辑
hdu 4431 Mahjong
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=4431幸亏哥有点麻将基础 提到三种和牌方式1: 7个不同的对子2: 传说中的十三幺 m1,m9,s1,s9,p1,p9,c1,c2,c3,c4,c5,c6,c7 然后再多一张 可以是 前面那13张中的任意一张3: 一个对子 外加 四个 (吃或碰)吃就是三张牌组成的顺子 碰就是三个牌一样思路 :枚举添加任意一张牌 但不能使某种牌的个数超过4然后判定是否是和牌判定第三种和牌时 先枚举去掉一个对子 然后看是否剩余的牌组成 四个 (吃或碰)注意:c1,c2,c3 像 东南西方这类的牌 没有顺子自己写的时候是因为一个地 阅读全文
posted @ 2012-11-03 17:24 夜-> 阅读(200) 评论(0) 推荐(0) 编辑
1474. About Frogs
摘要:http://acm.timus.ru/problem.aspx?space=1&num=1474找规律 然后模拟规律: 假设隔一个跳为 jump,相邻跳为 mov (mov 分为从左向右 movl_r 和从右向左 movr_l)jump 的优先级高于 mov对于 mov 当空格在 左面 movl_r 优先级高 当空格在 右面 movr_l 优先级高 当空格在中间 优先级任意 但要始终不变。代码:#include<iostream>#include<cstdio>#include<cstring>#include<string>#incl 阅读全文
posted @ 2012-10-19 10:44 夜-> 阅读(149) 评论(0) 推荐(0) 编辑
poj 3393 Lucky and Good Months by Gregorian Calendar
摘要:http://poj.org/problem?id=3393伤不起呀 题目也太长了吧不过也学到了点常识解释见代码注释#include<iostream>#include<cmath>#include<string>#include<algorithm>#include<queue>#include<cstring>#include<cstdio>using namespace std;const int K=700000000;int Days[15]={0,31, 28, 31, 30, 31, 30, 31 阅读全文
posted @ 2012-05-20 10:51 夜-> 阅读(233) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示