A: 思路: 水题,没啥意思; B: 思路: 暴力,也没啥意思; C: 思路: 思维,可以发现从前往后和为b[i]的分成一块,然后这一块里面如果都相同就没法开始吃,然后再暴力找到那个最大的且能一开始就开吃的那个怪物,然后就开始吃就好了; 话说那个医生居然等怪物吃完了才开始治疗,啧啧啧; D: 思路:
转载
2016-11-03 15:36:00
71阅读
2评论
【A】模拟,顺序扫一遍,维护最大值即可!【B】因为最多交换一个,直接先处理出不交换的答案,然后扫描一遍,对每一个交换之后,计算新的答案维护最大值!【C】贪心,主要是合法性的判断,不合法的有3种,第一种两个序列的和不等,第二种最初时的怪物总体重与某时刻的怪物总体重不相等,第三种在最初时的怪物序列某段中,不存在任何一只怪物能够吃掉相邻怪物!其他情况都是有解的了,具体看代码吧!【代码君】////Crea
原创
2022-04-19 17:30:09
68阅读
F - Drivers Dissatisfaction 题目大意:给你n个点,m条边,每个边都有一个权重w,每条边也有一个c表示,消耗c元可以把这条边的权重减1,求最多消耗s元的最小生成树。 思路:因为一条边的权重没有下限所以s元肯定是用在一条边上的。 那么我们先跑一个最小生成树,把这棵最小生成树建
转载
2018-03-30 14:51:00
30阅读
2评论
D. Kostya the Sculptor time limit per test 3 seconds memory limit per test 256 megabytes input standard input output standard output D. Kostya the Scu
转载
2016-11-01 13:38:00
49阅读
2评论
C. Epidemic in Monstropolis time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output C. Epidemic i
转载
2016-11-01 12:44:00
72阅读
2评论
http://codeforces.com/contest/733/problem/F 题意:给你一些城市和一些路,每条路有不满意程度和每减少一点不满意程度的花费,给出最大花费,要求找出花费小于s的最小生成树中最小的不满意程度 题解:首先明确的是肯定只删除一条路然后其他的找最小生成树即可,但是直接搞
转载
2018-04-22 01:15:00
25阅读
2评论
原题链接C. Epidemic in Monstropolistime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputThere was an epidemic
原创
2023-06-12 17:25:07
23阅读
C. Epidemic in Monstropolis time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output There was an
转载
2016-11-01 14:14:00
55阅读
2评论
原题链接D. Kostya the Sculptortime limit per test3 secondsmemory limit per test2
原创
2023-06-12 17:24:52
18阅读
大体题意:有n个怪兽在排队,告诉你刚开始每个怪兽的序列最后一个怪兽的体重 一定是刚
原创
2023-05-15 00:13:32
63阅读
http://codeforces.com/contest/733/problem/D 给定n个长方体,然后每个长方体都能选择任何一个面,去和其他长方体接在一起,也可以自己一个,要求使得新的长方体的最短的那条边最大。 看样例2就知道,因为10、8、7和10、8、2组合后,min = 8,是最大的。
原创
2022-10-20 11:15:57
39阅读
D. Kostya the Sculptor time limit per test 3 seconds memory limit per test 256 megabytes input standard input output standard output Kostya is a genia
转载
2016-11-01 14:17:00
73阅读
2评论
大体题意:你有n 个长方体形状的石头,你要送给你的朋友,你做多选择两个石头
原创
2023-05-15 00:13:03
64阅读
public class Solution {
public int KthSmallest(int[,] matrix, int k) {
var row = matrix.GetLength(0);
var col = matrix.GetLength(1);
var list = new List<int>
转载
2017-05-13 11:42:00
14阅读
DFS连通块,思路就是搜到底,然后一个一个回溯(填上X)上来#include #include #include #include #include #include #include #include #include #include using namespace std;#...
转载
2016-07-04 09:17:00
53阅读
2评论
B. Parade time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output B. Parade time limit per test 1
转载
2016-11-01 11:23:00
60阅读
2评论
题目传送门一、解题思路二、实现代码#include <bits/stdc++.h>#define x first#define y secondusing namespace std;typedef pair<int, int> PII;const int N = 110;int n, m, k;PII match[N][N];bool g[N][N], st[N]
原创
2022-04-20 16:00:54
132阅读
点击打开链接
A. Playing with Dice
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output
Two players are p
原创
2022-09-07 16:44:06
64阅读
...
转载
2021-07-24 20:02:00
96阅读
2评论
题目意思:有n个参赛者,他们都需要参加两场半决赛。第一场半决赛的成绩依次是a1, a2, ..., an,分别对应第1~第n个人的成绩。第二场则是b1, b2, ..., bn。其中这两个序列都是以递增方式排列的。需要从中找出有机会跻身于总决赛的人(标记为1)包括成绩排名前k人(对应成绩是a1,b1
转载
2019-10-24 21:05:00
43阅读
2评论