B. Hamming Distance Sum time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output     Genos needs your help. He was asked to solve the following programming problem by Saitama: The length of some st…
A - Infinite Sequence  CodeForces - 622A 题目大意:给你一个这样的数列1,1,2,1,2,3,1,2,3,4,1,2,3,4,5....就是从1~n排列(n++).最后问你第n个位置是什么数字. 思路:如果你花点时间列数列的话会发现,1~n的最后一位对应的位置是1~n的和,那我们就大胆使用二分进行搜索这位数. #include<iostream> #include<algorithm> #include<cstdio> #incl…
C. Socks time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output   Arseniy is already grown-up and independent. His mother decided to leave him alone for m days and left on a vacation. She have pr…
B. Hamming Distance Sum time limit per test: 2 seconds memory limit per test:256 megabytes input: standard input output: standard output Genos needs your help. He was asked to solve the following programming problem by Saitama: The length of some str…
链接: https://codeforces.com/contest/1230/problem/D 题意: Marcin is a coach in his university. There are n students who want to attend a training camp. Marcin is a smart coach, so he wants to send only the students that can work calmly with each other. L…
http://codeforces.com/gym/101078 和ysy.方老师一起打的virtual 打的不是很好...下面按过题顺序放一下过的题的题(dai)解(ma). A 给两个1~n的排列,把它们割成尽量短的一些段,使得每一段sort之后一样. 随便写个hash了事(1min交是因为之前顺手写了这题) #include <iostream> #include <stdio.h> #include <math.h> #include <string.h&…
题目链接:http://codeforces.com/contest/519/problem/C 题目意思:给出 n 个  experienced participants  和 m 个 newbies ,需要组成尽量多的组,组由3个人组成.有两种组合方式:(1)1 个 experienced participant 和 2 个  newbie  (2)2 个 experienced participant 和 1 个  newbie.问最多能组成的组数是多少组. 昨天做的时候不是暴力做的,惯性…
C. A and B and Team Training time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output A and B are preparing themselves for programming contests. An important part of preparing for a competition is s…
Codeforces 1132 D 题意:给\(n\)个电脑的电量和耗电速度,你可以买一个充电器,它的充电速度是每秒\(v\)单位,\(v\)你自己定.问最小的\(v\)能使得在\(k\)秒内每秒给某电脑充电,没有电脑的电量小于\(0\). 思路:首先二分\(v\),然后\(check\)的时候是这样的: 维护每一个电脑没电的时间,每次将最早没电的那个给充电一秒,如果最早没电的那个在充点前已经没电了,那么就肯定完蛋,否则一直跑到第\(k\)秒看是否能跑完.…
题目链接:https://codeforces.com/contest/1132/problem/D 题意: 有 $n$ 个学生,他们的电脑有初始电量 $a[1 \sim n]$,他们的电脑每分钟会耗电 $b[1 \sim n]$,现在有一场比赛持续 $k$ 分钟. 要你买一个充电器,使得每个学生的电脑在比赛期间的任何时候的电量都不会低于 $0$(可以等于 $0$),你要求出这个充电器每分钟充电量最少是多少. 题解: 看到这种题目,应当条件反射想到二分. 假设我们现在知道充电器每分钟的充电量是…