比赛链接:点击打开链接

上来先搞了f、c,,然后发现状态不正确,一下午都是脑洞大开,,

无脑wa,无脑ce。。。一样的错犯2次。。

硬着头皮搞了几发,最后20分钟码了一下G,不知道为什么把1直接当成不能加油的站就会wa。。太弱。。

唔···太懒第二天才发题解。。

B:Gears

并查集

题解:点击打开链接

C:Consecutive Blocks

离散化一下然后模拟

题解:点击打开链接

D:An Easy Game

设dp[i][j]为前i个位置已经匹配了j个位置的方法数。

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <queue>
#include <string>
#include <vector>
#include <stack>
#include <map>
#include <set>
#include <algorithm>
#include <iostream> using namespace std; #define ll long long
#define mod 1000000009
#define N 105 int n, K, m;
int dp[N][N];
int C[N][N];
string s1;
string s2; int dfs(int differ, int left) {
if (left == 0) {
return differ == 0;
}
else {
if (~dp[differ][left]) {
return dp[differ][left];
}
int &ans = dp[differ][left];
ans = 0;
int a = differ;
int b = n - differ;
for (int i = 0; i <= differ && i <= m; ++i) {
if (b >= m - i) {
ans += (int)((ll)C[b][m - i] * C[a][i] % mod * dfs(differ - i + (m - i), left - 1) % mod);
ans %= mod;
}
}
return ans;
}
} int main(){
for (int i = 0; i < N; ++i) {
C[i][i] = 1;
for (int j = 0; j < i; ++j) {
C[i][j] = C[i - 1][j - 1] + C[i - 1][j];
C[i][j] %= mod;
}
}
while (cin >> n >> K >> m){
cin >> s1 >> s2;
int nSum = 0;
int nLen = s1.length();
for (int i = 0; i < nLen; ++i) {
if (s1[i] != s2[i]) {
++nSum;
}
}
memset(dp, -1, sizeof(dp));
int ans = dfs(nSum, K);
printf("%d\n", ans);
}
return 0;
}

E:Romantic Value

简单最小割。

题解:点击打开链接

F:First Digit

屌丝题。。

#include <stdio.h>
#include <string.h>
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <string>
#include <math.h>
#include <stdlib.h>
#include <time.h>
using namespace std;
int main()
{
int T ,m,u,v,w; scanf("%d",&T);
while(T--){ scanf("%d%d",&u,&v);puts("1"); }
return 0;
}

G:Greedy Driver

spfa2次,,

题解:点击打开链接

H:Grouping

缩点拓扑序下求最长链

题解:点击打开链接

ZOJ Monthly, June 2014 月赛BCDEFGH题题解的更多相关文章

  1. 记次浙大月赛 134 - ZOJ Monthly, June 2014

    链接 虽做出的很少,也记录下来,留着以后来补..浙大题目质量还是很高的 B 并查集的一些操作,同类和不同类我是根据到根节点距离的奇偶判断的,删点是直接新加一个点,记得福大月赛也做过类似的,并差集的这类 ...

  2. ZOJ Monthly, June 2014 解题报告

    A.Another Recurrence Sequence problemId=5287">B.Gears 题目大意:有n个齿轮,一開始各自为一组.之后进行m次操作,包含下面4种类型: ...

  3. 浙大月赛ZOJ Monthly, August 2014

    Abs Problem Time Limit: 2 Seconds Memory Limit: 65536 KB Special Judge Alice and Bob is playing a ga ...

  4. 135 - ZOJ Monthly, August 2014

    135 - ZOJ Monthly, August 2014 A:构造问题,推断序列奇偶性.非常easy发现最小值不是1就是0.最大值不是n就是n - 1,注意细节去构造就可以 E:dp.dp[i][ ...

  5. ZOJ Monthly, November 2014

    做了一次月赛,没想到这么难,加上后来补上的题目也只有3个题.第一名也只有4个题啊啊啊啊~.其中两道还是水题.留坑慢慢补上来. 3832 Tilt Cylinder 给定如图所示有盖圆柱体,R,H,水面 ...

  6. ZOJ Monthly, August 2014

    A Abs Problem http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=5330 找规律题,构造出解.copyright@ts ...

  7. ZOJ Monthly, June 2018 Solution

    A - Peer Review Water. #include <bits/stdc++.h> using namespace std; int t, n; int main() { sc ...

  8. 137 - ZOJ Monthly, November 2014 - J Poker Face

    Poker Face Time Limit: 2 Seconds      Memory Limit: 65536 KB As is known to all, coders are lack of ...

  9. ACM ICPC 2018 青岛赛区 部分金牌题题解(K,L,I,G)

     目录: K Airdrop I Soldier Game L Sub-cycle Graph G Repair the Artwork ———————————————————— ps:楼主脑残有点严 ...

随机推荐

  1. C/S系统实现两数求和(非阻塞+epoll+心跳包检测用户在线状况+滚动日志+配置文件.)

    C/S系统实现两数求和 任务要求: 实现配置文件 实现日志滚动 设置非阻塞套接字,EPOLL实现 检测客户端的连接,设置心跳检测 主线程 + 心跳检测线程 + EPOLL的ET模式处理事务线程 注意事 ...

  2. Arithmetic Sequence(dp)

    Arithmetic Sequence Time Limit: 1 Sec  Memory Limit: 128 MBSubmit: 51  Solved: 19[Submit][Status][We ...

  3. 使用SqlCacheDependency依赖项让数据库变化后缓存失效

    SqlCacheDependency可以使缓存在数据库或者数据库某张表或者字段变化后让指定缓存失效.对于一些需要及时显示的信息比较有用. 需要.net2.0以后设sql server2005及以后版本 ...

  4. AFNetwork 作用和使用方法具体解释

    转自:http://www.maxiaoguo.com/clothes/269.html AFNetworking是一个轻量级的iOS网络通信类库.它建立在NSURLConnection和NSOper ...

  5. [视频] x264 压缩笔记

    转载本站文章请注明,转载自:扶凯[http://www.php-oa.com] 本文链接: http://www.php-oa.com/2009/03/22/x264.html 象x264本身是不能直 ...

  6. css-下拉菜单案例

    <!DOCTYPE html>CSS4-布局2-display下拉菜单案例 <style>.xiala{width:200px;background:#ddd;}.xiala ...

  7. hdu 2504

    Problem Description 有三个正整数a,b,c(0<a,b,c<10^6),其中c不等于b.若a和c的最大公约数为b,现已知a和b,求满足条件的最小的c. Input 第一 ...

  8. OpenSSl编译

    1.下载openssl代码,下载地址:http://www.openssl.org/source/ ,如果使用winrar解压失败的话(提示不能创建符号链接),可以关闭UAC.2.下载安装Active ...

  9. Niagara AX之在Station下显示Home节点

    默认的Station下是没有Home节点的,那么,这个Home节点是怎么添加上去的呢? 注意Home后面的描述(Description):“Navigation tree defined by nav ...

  10. linux下python多版本共存

    为何要安装python,linux下不是已经集成了python吗? 大多数linux系统都集成了python,但是他们的版本太低了.不能满足我们的需求,尤其是好多系统居然仍停留在 python2.6. ...