随笔分类 - 思维题
摘要:Andrewid the Android is a galaxy-famous detective. He is now investigating the case of vandalism at the exhibition of contemporary art...
阅读全文
摘要:Edward, the headmaster of the Marjar University, is very busy every day and always forgets the date.There was one day Edward suddenly ...
阅读全文
摘要:The name of one small but proud corporation consists of n lowercase English letters. The Corporation has decided to try rebranding — a...
阅读全文
摘要:Given a m-by-n (0,1)-matrix, of all its submatrices of all 1’s which is the largest? By largest we mean that the submatrix has the mos...
阅读全文
摘要:链接:https://ac.nowcoder.com/acm/contest/551/D来源:牛客网 时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 524288K,其他语言1048576K64bit IO Format: %lld题目描述CSL 以前不...
阅读全文
摘要:Find an n × n matrix with different numbers from 1 to n2, so the sum in each row, column and both main diagonals are odd.InputThe only...
阅读全文
摘要:The city of Fishtopia can be imagined as a grid of 44 rows and an odd number of columns. It has two main villages; the first is locate...
阅读全文
摘要:Arkady plays Gardenscapes a lot. Arkady wants to build two new fountains. There are n available fountains, for each fountain its beaut...
阅读全文
摘要:Sasha likes programming. Once, during a very long contest, Sasha decided that he was a bit tired and needed to relax. So he did. But s...
阅读全文
摘要:Can the greatest common divisor and bitwise operations have anything in common? It is time to answer this question.Suppose you are giv...
阅读全文
摘要:Olesya loves numbers consisting of n digits, and Rodion only likes numbers that are divisible by t. Find some number that satisfies bo...
阅读全文
摘要:链接:https://ac.nowcoder.com/acm/contest/332/I来源:牛客网 题目描述bleaves 最近在 wzoi 上面做题。wzoi 的题目有两种,一种是 noip 题,一种是省选题。bleaves 的做题方式很特别。每一天,她可能会看一...
阅读全文
摘要:标题:分糖果 有n个小朋友围坐成一圈。老师给每个小朋友随机发偶数个糖果,然后进行下面的游戏: 每个小朋友都把自己的糖果分一半给左手边的孩子。 一轮分糖后,拥有奇数颗糖的孩子由老师补给1个糖果,从而变成偶数。 反复进行这个游戏,直到所有小朋友的糖...
阅读全文
摘要:链接:https://ac.nowcoder.com/acm/contest/329/I来源:牛客网 时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 262144K,其他语言524288K64bit IO Format: %lld题目描述处女座放完了"高...
阅读全文
摘要:Description 有一环形地铁,一共有nn站,编号1-n1−n。正向行驶地铁会按照1->2->3->⋯->n->1的方向行驶反向则按照1->n->⋯->3->2->1的方向行驶。给定相邻两站之间的地铁行驶时间(正向、反向时间相同),现在有mm组询问,每次询问从第...
阅读全文
摘要:链接:https://ac.nowcoder.com/acm/contest/327/H来源:牛客网 题目描述处女座进行了一场c语言的考试,要求很简单,输出2000个正整数,并且满足以下条件:1. 任意两个数互质2. 任意两个数x,y,满足,其中为...
阅读全文
摘要:You have a garland consisting of nn lamps. Each lamp is colored red, green or blue. The color of the ii-th lamp is sisi ('R', 'G' and ...
阅读全文
摘要:Recently you have received two positive integer numbers xx and yy. You forgot them, but you remembered a shuffled list containing all ...
阅读全文
摘要:You are given a 4x4 grid. You play a game — there is a sequence of tiles, each of them is either 2x1 or 1x2. Your task is to consequen...
阅读全文
摘要:Two people are playing a game with a string ss, consisting of lowercase latin letters.On a player's turn, he should choose two consecu...
阅读全文