传送门 •题意 先给一个白矩阵,再两个黑矩阵 如果两个黑矩阵能把白矩阵包含,则输出NO 否则输出YES •思路 计算几何题还是思维题呢? 想起了上初中高中做几何求面积的题 这个就类似于那样 包含的话分两种情况讨论,其他的不包含 ①白矩形在一个黑矩形内部 这种情况直接判断边界就可以 ②白矩形在两个黑矩形组合的图形内部 首先这个情况的前提是两个黑矩形必须能连接起来 白矩形和两个黑矩形分别会有重合,重合的地方可能会在此重合, 例如 白矩形(1 1 4 2)   黑1矩形(1 0 3 4)  黑2矩形(…
链接: https://codeforces.com/contest/1216/problem/C 题意: There is a white sheet of paper lying on a rectangle table. The sheet is a rectangle with its sides parallel to the sides of the table. If you will take a look from above and assume that the botto…
题目链接:Round #587 题目答案:官方Editorial.My Solution A. Prefixes 题意:给一字符串,只含有'a'或'b',需要改变某些位置('a'变'b'或'b'变'a'),使得该字符串任意偶数长度前缀中'a'和'b'个数相等,求改变的最少次数以及更改后的字符串. 题解:遍历,判断s[2i]和s[2i+1]是否相等.如果相等,需要一次更改,并将其中一个改为不同字母. B. Shooting 题意:给\(n\)个编号\(1\)~\(n\)的射击目标,每个目标有不同的…
https://codeforces.com/contest/1216/problem/A A. Prefixes 题意大概就是每个偶数位置前面的ab数目要相等,很水,被自己坑了 1是没看见要输出修改后的字符串,2是修改的写反了..3是忘记清零了?,生生把罚时拖的... 本来四分钟的题的..然后罚时+10分钟过题,我晕了,以后还是要再认真一点,比如说把样例测完.. #include<bits/stdc++.h> using namespace std; typedef long long ll…
C. White Sheet There is a white sheet of paper lying on a rectangle table. The sheet is a rectangle with its sides parallel to the sides of the table. If you will take a look from above and assume that the bottom left corner of the table has coordina…
Educational Codeforces Round 40 (Rated for Div. 2) C. Matrix Walk time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output There is a matrix A of size x × y filled with integers. For every , *A**i, …
https://codeforces.com/contest/1256 A:Payment Without Change[思维] 题意:给你a个价值n的物品和b个价值1的物品,问是否存在取物方案使得价值为s 题解:min(s/n,a)*n+b>=s?YES:NO #include<iostream> #include<cstdio> #include<cstdlib> #include<cmath> #include<algorithm>…
题目连链接:http://codeforces.com/contest/231 A. Team time limit per test:2 seconds memory limit per test:256 megabytes One day three best friends Petya, Vasya and Tonya decided to form a team and take part in programming contests. Participants are usually…
A. Taymyr is calling you time limit per test:1 second memory limit per test:256 megabytes input:standard input output:standard output Comrade Dujikov is busy choosing artists for Timofey's birthday and is recieving calls from Taymyr from Ilia-alpinis…
A. Vladik and Courtesy time limit per test:2 seconds memory limit per test:256 megabytes input:standard input output:standard output At regular competition Vladik and Valera won a and b candies respectively. Vladik offered 1 his candy to Valera. Afte…