文明大学生

数学公式

2019年11月17日

K - King of the Waves Gym - 101666K

摘要: #include<cstdio> #include<cstring> #include<string> #include<vector> #include<iostream> using namespace std; typedef long long ll; /* 这道题,1代表能打过他,0代表打 阅读全文

posted @ 2019-11-17 22:25 文明大学生 阅读(166) 评论(0) 推荐(0) 编辑

2019年11月1日

F - You Are Given Some Letters... CodeForces - 1202F

该文被密码保护。 阅读全文

posted @ 2019-11-01 20:45 文明大学生 阅读(0) 评论(0) 推荐(0) 编辑

分块

该文被密码保护。 阅读全文

posted @ 2019-11-01 20:30 文明大学生 阅读(0) 评论(0) 推荐(0) 编辑

LOL UVALive - 8521

摘要: #include using namespace std; /* 题意有点模糊不全,敌方选人如何选不知道 我们假设敌方选人和我方选人一样,选的顺序不一样,即使选的英雄一样也不行 禁英雄,只要禁的一样,那么就说是同一种情况 那么此题就转成排列组合 我方先选出人来,然后乘A(95,5)*C(90,5)*C(85,5) 如何计算我放选人的组合数 状压dp dp[i][j]表示选到第i个英雄,... 阅读全文

posted @ 2019-11-01 20:04 文明大学生 阅读(141) 评论(0) 推荐(0) 编辑

2019年10月26日

E - You Are Given Some Strings... CodeForces - 1202E

摘要: #include #define FRER() freopen("i.txt","r",stdin); using namespace std; /* ac自动机 我们考虑两个串的连接处,对于文本串,如果在t[i]匹配了x个,那么说明以 t[i]为结尾的串有x,反着找val[t[i]],说明以t[i]为结尾的串有x,记录乘积 来反应最终有多少贡献值 傻逼了,把int ch,弄成char ch了... 阅读全文

posted @ 2019-10-26 22:35 文明大学生 阅读(158) 评论(0) 推荐(0) 编辑

D - Polyline Simplification Kattis - simplification

摘要: 题意:给你n+1个点,让你剩下m+1个点 。 删除的方法是,取出来构成最小三角形的中间点,去除那个点,最后输出去除点的顺序。 解法:先求出来每个三角形的面积,用set 排序或者用优先队列 都OK 每次取出来最小值Pop 并且更新左右点 两端点需要特殊处理下 阅读全文

posted @ 2019-10-26 20:58 文明大学生 阅读(173) 评论(0) 推荐(0) 编辑

2019年10月20日

C - You Are Given a WASD-string... CodeForces - 1202C

摘要: #include <bits/stdc++.h> using namespace std; typedef long long ll; const int maxn=2e5+100; char s[maxn]; /* 这个字符不是随便可以加的,因为会出现,你加了一个字符 使左边的最小值往右边移了一下,但是导致最右边往右移了,得不偿失 首先我们考虑垂直方向,我们假设它在0这个位置,那么他所移动的 位 阅读全文

posted @ 2019-10-20 16:56 文明大学生 阅读(296) 评论(0) 推荐(0) 编辑

2019年10月19日

B - You Are Given a Decimal String... CodeForces - 1202B

摘要: #include <bits/stdc++.h> using namespace std; /* 这道题的难点在于怎样加x或者y才能使的a转化为b,并且加的x和y的和最少 这道题竟然用了floyd,转换成求最短路 这才深刻地体会到,我根本不会算法 */ const int maxn=10; const int INF=0x3f3f3f3f; int dis[maxn][maxn]; int num 阅读全文

posted @ 2019-10-19 10:40 文明大学生 阅读(155) 评论(0) 推荐(0) 编辑

D - Print a 1337-string... CodeForces - 1202D

摘要: #include <bits/stdc++.h> using namespace std; /* 给你一个数n,让你求一个串,里面的子序列“1337”的数量恰好为n 开始时用1的数量*C(m,2)*7的数量,不好处理 题解中用13377773333337的形式,使得C(m,2)+7的数量=n; 这样更好处理 */ typedef long long ll; const int maxn=1e9; 阅读全文

posted @ 2019-10-19 09:45 文明大学生 阅读(119) 评论(0) 推荐(0) 编辑

2019年10月12日

C - Anna, Svyatoslav and Maps CodeForces - 1204C

该文被密码保护。 阅读全文

posted @ 2019-10-12 21:34 文明大学生 阅读(0) 评论(0) 推荐(0) 编辑

导航