Day 1, Div 2, Prob. B - 吃豆豆 题目大意 wls有一个\(n\)行\(m\)列的棋盘,对于第\(i\)行第\(j\)列的格子,每过\(T[i][j]\)秒会在上面出现一个糖果,糖果只存在一秒,下一秒就会消失. 假如wls第\(k\)秒在第\(i\)行第\(j\)列的格子上,满足\(T[i][j]|k\),则wls会得到一个糖果. wls每一秒只可以上下左右移动一格或停在原地. 请问wls从指定的\(S(xs,ys)\)出发到达指定的\(T(xt,yt)\),并且在路上…
#include<bits/stdc++.h> #define forn(i, n) for (int i = 0; i < int(n); i++) #define fore(i, s, t) for (int i = s; i < (int)t; i++) #define fi first #define se second #define all(x) x.begin(),x.end() #define pf2(x,y) printf("%d %d\n",…
题目: In some social network, there are nn users communicating with each other in mm groups of friends. Let's analyze the process of distributing some news between users. Initially, some user xx receives the news from some source. Then he or she sends…
BaoBao has just found a string of length consisting of 'C' and 'P' in his pocket. As a big fan of the China Collegiate Programming Contest, BaoBao thinks a substring of is "good", if and only if 'C', and 'P', where denotes the -th charact…
The 2017 China Collegiate Programming Contest Qinhuangdao Site is coming! There will be teams participating in the contest, and the contest will be held on a huge round table with seats numbered from 1 to in clockwise order around it. The -th team…
A. 题意:就是有一个大桌子,环绕有顺势站1~m共m个座位,n个选手坐在部分位置上.然后如果有一个人a了一道题,却没有立刻发气球给他,他产生怒气值是发气球给他的时间减去a题时间.现在有一个机器人顺时针环绕桌子发球,每个单位时间走过一个位置.问机器人在哪个位置开始发气球总怒气值最小,输出最小怒气值. 其实是个傻逼思维题.假如他从位置m开始发气球,对于每个位置i,他到达的时间为k*m+i,所以对于每个它在时刻t a的题,他需要等待t-(k*m+i)中最小的正整数时间.随便算算就能知道每一题从m位置开…
PUBG is a multiplayer online battle royale video game. In the game, up to one hundred players parachute onto an island and scavenge for weapons and equipment to kill others while avoiding getting killed themselves. BaoBao is a big fan of the game, bu…
BaoBao is trapped in a one-dimensional maze consisting of grids arranged in a row! The grids are numbered from 1 to from left to right, and the -th grid is marked with a character , where is either 'L' or 'R'. Starting from the -th grid, BaoBao wi…
Given an array of integers , we say a set is a prime set of the given array, if and is prime. BaoBao has just found an array of integers in his pocket. He would like to select at most prime set of that array to maximize the size of the union o…
DreamGrid has a nonnegative integer . He would like to divide into nonnegative integers and minimizes their bitwise or (i.e. and should be as small as possible). Input There are multiple test cases. The first line of input contains an integer , i…
Crusaders Quest is an interesting mobile game. A mysterious witch has brought great darkness to the game world, and the only hope for your kingdom is to save the Goddesses so that they can unleash their power to fight against the witch. In order to s…