D. Yet Another Monster Killing Problem You play a computer game. In this game, you lead a party of…
You play a computer game. In this game, you lead a party of mm heroes, and you have to clear a dungeon with nn monsters. Each monster is characterized by its power aiai. Each hero is characterized by his power pipi and endurance sisi. The heroes clea…
题目连接: https://codeforces.com/contest/1257/problem/D 题目大意: n个怪兽,m个英雄,每个怪兽有一定的能力值,每个英雄有一定的能力值和一定的耐力值.耐力值得含义是每天可以击杀怪兽的最多数目.当英雄的能力值大于怪兽的能力值时,英雄可以击杀怪兽,然后问击杀 所有的怪兽所需要的最短时间,如果不能击杀所有怪兽,输出-1: 思路:主要是一个对一个mx数组的理解mx[i]的含义是在耐力值为i的情况下,英雄的最大能力. #include<bits/stdc++…
题意:给定一些怪物,每天可以选一个勇士进去打怪,每个勇士每天只能打不超过si个怪物,每个勇士只能打能力值≤pi的怪物,问最少多少天打完所有怪物 题解:贪心,每天尽可能多的去打怪,那么存一个对于长度为i的怪物可以用的最大的能力值是多少,每天枚举长度,尽可能长的去打怪即可 代码: #include<iostream> #include<cstdio> #include<cstdlib> #include<cstring> #include<string&g…
Educational Codeforces Round 40 F. Runner's Problem 题意: 给一个$ 3 * m \(的矩阵,问从\)(2,1)$ 出发 走到 \((2,m)\) 的方案数 \(mod 1e9 + 7\), 走的规则和限制如下: From the cell (i, j) you may advance to: (i - 1, j + 1) - only if i > 1, (i, j + 1), or (i + 1, j + 1) - only if i <…
A - Noldbach problem 题面链接 http://codeforces.com/contest/17/problem/A 题面 Nick is interested in prime numbers. Once he read about Goldbach problem. It states that every even integer greater than 2 can be expressed as the sum of two primes. That got Nic…
http://codeforces.com/contest/459/problem/D 题意:给你n个数,然后统计多少组(i,j)使得f(1,i,ai)>f(j,n,aj); 思路:先从左往右统计f(1,i,ai)记录在b[i],然后从右往左统计f(j,n,aj)记录在c[i],然后利用树状数组统计个数即可. #include <cstdio> #include <iostream> #include <cstring> #include <cmath>…
Pashmak and Parmida's problem Time Limit:3000MS     Memory Limit:262144KB     64bit IO Format:%I64d & %I64u Submit Status Practice CodeForces 459D Description Parmida is a clever girl and she wants to participate in Olympiads this year. Of course she…
C. Commentator problem 题目连接: http://www.codeforces.com/contest/2/problem/C Description The Olympic Games in Bercouver are in full swing now. Here everyone has their own objectives: sportsmen compete for medals, and sport commentators compete for more…
题目链接  Educational Codeforces Round 40  Problem I 题意  定义两个长度相等的字符串之间的距离为:   把两个字符串中所有同一种字符变成另外一种,使得两个字符串相等所需要操作的次数的最小值.   求$s$中每一个长度为$t$的长度的连续子串与$t$的距离.字符集为小写字母$a$到$f$ 首先解决求两个长度相等的字符串之间的距离这个问题. $s$和$t$相同位上的字母连一条无向边,最后的答案是$s$和$t$中所有出现过的字符的个数减去这个无向图的连通块…