Codeforces Round #364 (Div. 2) A 水】的更多相关文章

A. Cards time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output There are n cards (n is even) in the deck. Each card has a positive integer written on it. n / 2 people will play new card game. At…
这场是午夜场,发现学长们都睡了,改主意不打了,第二天起来打的virtual contest. A题 http://codeforces.com/problemset/problem/701/A 巨水无比,好像三四分钟就直接A了...直接n²暴力. #include <cstdio> #include <map> #include <queue> #include <cstring> #include <algorithm> #include &l…
A. Mishka and Game time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Mishka is a little polar bear. As known, little bears loves spending their free time playing dice for chocolates. Once in…
题目链接:http://codeforces.com/contest/701/problem/D 题意: 给出n个学生和能载k个学生的车,速度分别为v1,v2,需要走一段旅程长为l,每个学生只能搭一次车,问最少时间到达目的地. 分析: 要使得时间最少,最后车和所有学生应该是同时到达的,我们可以观察到第一组乘车的学生和最后一组乘车的学生两者搭车时间和走路时间是相同的,那么猜想中间所有组的的学生乘车时间和走路时间是相同的(不是乘车==走路),即所有学生的乘车时间相同,走路时间相同.那么第一组学生时间…
题目链接: http://codeforces.com/contest/701/problem/C 题意: 给出一个长度为n的字符串,要我们找出最小的子字符串包含所有的不同字符. 分析: 1.尺取法,不懂得可以看今天开始学算法系列-尺取法 2.二分法,具体见代码 PS:因为讲得太少所以附上A和B的题解: A:结构体存储,将所有数sort一下,一头一尾输出即可 B:开辆个数组记录当前行或列是否有车,row[],col[],设两个变量a,b记录行列,放入一个车时,如果已标记则不用减去,否则减去(a-…
http://codeforces.com/problemset/problem/700/B 题目大意:给你一棵树,给你k个树上的点对.找到k/2个点对,使它在树上的距离最远.问,最大距离是多少? 思路:我们可以把树上的这个分成两个集合,然后两边的点的数目相等.符合这个条件的就是树的重心,所以我们只需要找到树的中心就行啦. //看看会不会爆int!数组会不会少了一维! //取物问题一定要小心先手胜利的条件 #include <bits/stdc++.h> using namespace std…
A. Anton and Polyhedrons time limit per test:2 seconds memory limit per test:256 megabytes input:standard input output:standard output Anton's favourite geometric figures are regular polyhedrons. Note that there are five kinds of regular polyhedrons:…
A. Buying A House time limit per test:2 seconds memory limit per test:256 megabytes input:standard input output:standard output Zane the wizard had never loved anyone before, until he fell in love with a girl, whose name remains unknown to us. The gi…
A. Dasha and Stairs time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output On her way to programming school tiger Dasha faced her first test — a huge staircase! The steps were numbered from one t…
A. Lunch Rush time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Having written another programming contest, three Rabbits decided to grab some lunch. The coach gave the team exactly k time u…