Codeforces Round #469 Div. 2 A B C D E】的更多相关文章

Codeforces Round #469 (Div. 2) 难得的下午场,又掉分了.... Problem A: 怎么暴力怎么写. #include<bits/stdc++.h> #define fi first #define se second #define mk make_pair #define pii pair<int,int> #define read(x) scanf("%d",&x) #define sread(x) scanf(&q…
题 OvO http://codeforces.com/contest/949/problem/C codeforces 949C 950E 解 建图,记原图为 G1,缩点,记缩完点后的新图为G2 缩完点后的图 G2 必定无环,求这个无环图 G2 中每个点的入度, 找出 的那些点,记这些点的集合为 S,然后把 S 中这些点映射到 G1 中,则这些点各自对应一个点集.S 的各点中,对应的最小集合即为所求集合 #include <iostream> #include <cstring>…
C. Zebras time limit per test memory limit per test 512 megabytes input standard input output standard output Oleg writes down the history of the days he lived. For each day he decides if it was good or bad. Oleg calls a non-empty sequence of days a …
贪心 题目大意,有2个宿管分别从1和n开始检查房间,记录人数不为n的房间个数,然后锁住房间. 没有被锁的房间中的学生可以选择藏在床底,留在原地,或者转移(最远转移d个房间)   然后抄了网上大神的代码. 首先,如果可以转移的人数够,能使外面的满足房间b人的条件,就尽量满足.如果人数不够,就全部向内进行转移. 所有的人都可以不断向内转移,所以最优的一种情况一定不会发现某个房间人数多了..(除了最靠内的房间) 然后保存一个区间和,一个房间一个房间进行判断. 这个思路好妙啊 #include<cstd…
tarjan 题意: 有n个数据维护中心,每个在h小时中需要1个小时维护,有m个雇主,他们的中心分别为c1,c2,要求这两个数据中心不能同时维护. 现在要挑出一个数据中心的子集,把他们的维护时间都推后一个小时.问最小推几个?   建图,如果对于一个顾客,两个数据维护中心维护时间正好差一个小时,那么前者向后者连一条边.在一个强连通分量里面的所有点必须选..如果有连向其他的强连通分量,那么那个也必须选,这种情况肯定不是最优,所以舍弃所有有出度的强连通分量.   tarjan缩点,然后判一判. #in…
A. Left-handers, Right-handers and Ambidexters 题意 \(l\)个左撇子,\(r\)个右撇子,\(a\)个两手均可.要组成一支队伍,里面用左手的人数与用右手的人数相等,问队伍最大人数. Code #include <bits/stdc++.h> #define F(i, a, b) for (int i = (a); i < (b); ++i) #define F2(i, a, b) for (int i = (a); i <= (b)…
A. Left-handers, Right-handers and Ambidexters time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output You are at a water bowling training. There are l people who play with their left hand, r peopl…
CF469 Codeforces Round #268 (Div. 2) http://codeforces.com/contest/469 开学了,时间少,水题就不写题解了,不水的题也不写这么详细了. A 水题 //#pragma comment(linker, "/STACK:102400000,102400000") #include<cstdio> #include<cmath> #include<iostream> #include<…
Codeforces Round #366 (Div. 2) A I hate that I love that I hate it水题 #I hate that I love that I hate it n = int(raw_input()) s = "" a = ["I hate that ","I love that ", "I hate it","I love it"] for i in ran…
Codeforces Round #354 (Div. 2) Problems     # Name     A Nicholas and Permutation standard input/output 1 s, 256 MB    x3384 B Pyramid of Glasses standard input/output 1 s, 256 MB    x1462 C Vasya and String standard input/output 1 s, 256 MB    x1393…