C. Robot Breakout time limit per test3 seconds memory limit per test256 megabytes inputstandard input outputstandard output n robots have escaped from your laboratory! You have to find them as soon as possible, because these robots are experimental,…
Codeforces Round #575 (Div. 3) 这个div3打的太差了,心态都崩了. B. Odd Sum Segments B 题我就想了很久,这个题目我是找的奇数的个数,因为奇数想分成x个奇数,那么这个x肯定是一个奇数, 偶数同理,如果一个偶数想分成y个奇数,那么这个y肯定是一个偶数. 所以数奇数的个数,如果奇数有x个,x是偶数,那么k一定是一个偶数,如果x是一个奇数,那么k肯定是一个奇数. 输出也比较简单,因为奇数要分成奇数个,所以可以前面每组都是含有一个奇数,最后肯定会有奇…
Bakery 题目链接: http://codeforces.com/contest/707/problem/B Description Masha wants to open her own bakery and bake muffins in one of the n cities numbered from 1 to n. There are m bidirectional roads, each of whose connects some pair of cities. To bake…
本蒟蒻已经掉到灰名了(菜到落泪),希望这次打完能重回绿名吧...... 这次赛中A了三题 下面是本蒟蒻的题解 A.Three Piles of Candies 这题没啥好说的,相加除2就完事了 #include<bits/stdc++.h> using namespace std; typedef long long ll; int main() { ll q; scanf("%lld",&q); while(q--) { ll a,b,c; scanf("…
C. Robot Breakout 题目大意: 一堆机器人,已知他们的初始位置(x,y),本来都可以向四个方向移动,但是一些原因,一个机器人的不能向某些方向移动,该方向能移动用1表示,否则用0 求他们能否到达同一点,如果能,输出这个点坐标 思路:维护四个最值,a,b,c,d a表示这群机器人能到达的左移x坐标的下界,b表示能上移y的上界,c表示右移x的上界,d表示下移y的下界 每次遇到机器人某方向不能移动,更新相应值. 最后判断上界下界的交是否非空 #include<bits/stdc++.h>…
比赛链接:https://codeforc.es/contest/1196 A. Three Piles of Candies 题意:两个人分三堆糖果,两个人先各拿一堆,然后剩下一堆随意分配,使两个人中最后糖果较少的那个人的糖果最多. 分析:水题. AC代码: #include <bits/stdc++.h> #define SIZE 300007 #define rep(i, a, b) for(int i = a; i <= b; ++i) typedef long long ll;…
A. Watching a movie time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output You have decided to watch the best moments of some movie. There are two buttons on your player: Watch the current minute…
A. Contest time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Misha and Vasya participated in a Codeforces contest. Unfortunately, each of them solved only one problem, though successfully sub…
传送门 B题题意: 给你n个数,让你把这n个数分成k个段(不能随意调动元素位置).你需要保证这k个段里面所有元素加起来的和是一个奇数.问可不可以这样划分成功.如果可以打印YES,之后打印出来是从哪里开始断开的. 否则打印出NO 题解: 加上奇数可以使和的性质改变,原来使偶数则变为奇数,奇数则变为偶数.加上一个偶数就不会有这样的变化.所以第一步就找出来有多少个奇数.因为要保证k个段的和都为奇数,所以每个段得先有一个奇数 剩下来的奇数数量如果是偶数那就不影响,这样就可以成功划分.如果是奇数那就划分不…
D. Robot Vacuum Cleaner time limit per test 1 second memory limit per test 256 megabytes Problem Description Pushok the dog has been chasing Imp for a few hours already. Fortunately, Imp knows that Pushok is afraid of a robot vacuum cleaner. While mo…