随笔分类 -  模拟

摘要:#include #include #include #include #include #include #define maxn 100001 using namespace std; char s[maxn]; bool w[maxn]; int S[maxn],n,top,tt,T; bool pd(int l,int r) { for (int i=l;i<=r;i... 阅读全文
posted @ 2016-07-23 19:53 Yangjiyuan 阅读(259) 评论(0) 推荐(0)
摘要:距离一个点最远的点一定是直径的一个端点。考虑运用这个原理,每次维护一下直径端点即可。 阅读全文
posted @ 2016-04-06 20:06 Yangjiyuan 阅读(181) 评论(0) 推荐(0)
摘要:先看成一条链 for一遍找位置 在for一遍算答案 阅读全文
posted @ 2016-03-26 22:07 Yangjiyuan 阅读(440) 评论(0) 推荐(0)
摘要:首先枚举等待牌,再枚举对子牌。 然后1~n扫一遍,如果现在 s[i]不能被3整除,那么必须跟后两个数搭配几下变成能被3整除的。然后如果能被3整除,那么只要三个连续的一组可行,则三个相同的一组必定也可行。因为如果有一种方案是3个连续的而最小数又能被3整除,那这种就必须有3n组,3n组的话三个相同的为一 阅读全文
posted @ 2016-03-25 20:58 Yangjiyuan 阅读(293) 评论(0) 推荐(0)
摘要:直接手动模拟 速度快啊。。 Language: C++ Result: Accepted Time:452 ms Memory:2836 kb Language: C++ Result: Accepted Time:452 ms Memory:2836 kb #include<algorithm> 阅读全文
posted @ 2016-03-25 20:53 Yangjiyuan 阅读(152) 评论(0) 推荐(0)