03 2020 档案
摘要:Freddy Frog is sitting on a stone in the middle of a lake. Suddenly he notices Fiona Frog who is sitting on another stone. He plans to visit her, but
阅读全文
摘要:Bessie is out in the field and wants to get back to the barn to get as much sleep as possible before Farmer John wakes her for the morning milking. Be
阅读全文
摘要:The 2018 World Cup was held recently in Russia. Some great soccer countries (e.g., Italy,Netherlands, Chile, USA) did not qualify for this World Cup.
阅读全文
摘要:A common pastime for poker players at a poker table is to shuffle stacks of chips. Shuffling chips is performed by starting with two stacks of poker c
阅读全文
摘要:The ministers of the cabinet were quite upset by the message from the Chief of Security stating that they would all have to change the four-digit room
阅读全文
摘要:Given a positive integer n, write a program to find out a nonzero multiple m of n whose decimal representation contains only the digits 0 and 1. You m
阅读全文
摘要:Farmer John knows that an intellectually satisfied cow is a happy cow who will give more milk. He has arranged a brainy activity for cows in which the
阅读全文
摘要:Farmer John has been informed of the location of a fugitive cow and wants to catch her immediately. He starts at a point N (0 ≤ N ≤ 100,000) on a numb
阅读全文
摘要:You are trapped in a 3D dungeon and need to find the quickest way out! The dungeon is composed of unit cubes which may or may not be filled with rock.
阅读全文
摘要:在一个给定形状的棋盘(形状可能是不规则的)上面摆放棋子,棋子没有区别。要求摆放时任意的两个棋子不能放在棋盘中的同一行或者同一列,请编程求解对于给定形状和大小的棋盘,摆放k个棋子的所有可行的摆放方案C。 Input 输入含有多组测试数据。每组数据的第一行是两个正整数,n k,用一个空格隔在一个n*n的
阅读全文
摘要:前有牛顿瘟疫“家里蹲”发明微积分。 现有 Cuber QQ 新冠肺炎“家里蹲”发明与矩阵。 与矩阵是一个 n×n 的矩阵。规定矩阵中的第 i 行第 j 列记为 (i,j) 。 生成一个与矩阵的方式是,先生成一个长度为 n 的数列 a1,a2,…,an−1,an ,而矩阵中 (i,j)=ai&aj 。
阅读全文
摘要:Cuber QQ 在疫情期间已经宅在家两个月了。 实在是无所事事的他,决定重操旧业,继续实现他曾经梦寐的钢琴演奏家梦想。 掀开积满了灰尘的钢琴盖,是他许久都未触碰的琴键,按下的瞬间,他发现,钢琴坏了。 Cuber QQ 有一个多年的弹奏习惯,他弹奏钢琴,同一时刻一定会同时按下 m 个琴键,他喜欢不同
阅读全文
摘要:给定一个二维网格和一个单词,找出该单词是否存在于网格中。 单词必须按照字母顺序,通过相邻的单元格内的字母构成,其中“相邻”单元格是那些水平相邻或垂直相邻的单元格。同一个单元格内的字母不允许被重复使用。 示例: board =[ ['A','B','C','E'], ['S','F','C','S']
阅读全文
摘要:给定一个包含了一些 0 和 1的非空二维数组 grid , 一个 岛屿 是由四个方向 (水平或垂直) 的 1 (代表土地) 构成的组合。你可以假设二维矩阵的四个边缘都被水包围着。 找到给定的二维数组中最大的岛屿面积。(如果没有岛屿,则返回面积为0。) 示例 1: [[0,0,1,0,0,0,0,1,
阅读全文
摘要:给定一个没有重复数字的序列,返回其所有可能的全排列。 示例: 输入: [1,2,3]输出:[ [1,2,3], [1,3,2], [2,1,3], [2,3,1], [3,1,2], [3,2,1]] 来源:力扣(LeetCode)链接:https://leetcode-cn.com/problem
阅读全文
摘要:给定一组不含重复元素的整数数组 nums,返回该数组所有可能的子集(幂集)。 说明:解集不能包含重复的子集。 示例: 输入: nums = [1,2,3]输出:[ [3], [1], [2], [1,2,3], [1,3], [2,3], [1,2], []] 链接:https://leetcode
阅读全文
摘要:给定一组不含重复元素的整数数组 nums,返回该数组所有可能的子集(幂集)。 说明:解集不能包含重复的子集。 示例: 输入: nums = [1,2,3]输出:[ [3], [1], [2], [1,2,3], [1,3], [2,3], [1,2], []] 链接:https://leetcode
阅读全文
摘要:两个整数的 汉明距离 指的是这两个数字的二进制数对应位不同的数量。 计算一个数组中,任意两个数之间汉明距离的总和。 示例: 输入: 4, 14, 2 输出: 6 解释: 在二进制表示中,4表示为0100,14表示为1110,2表示为0010。(这样表示是为了体现后四位之间关系)所以答案为:Hammi
阅读全文
摘要:UTF-8 中的一个字符可能的长度为 1 到 4 字节,遵循以下的规则: 对于 1 字节的字符,字节的第一位设为0,后面7位为这个符号的unicode码。对于 n 字节的字符 (n > 1),第一个字节的前 n 位都设为1,第 n+1 位设为0,后面字节的前两位一律设为10。剩下的没有提及的二进制位
阅读全文
摘要:有一个正整数数组 arr,现给你一个对应的查询数组 queries,其中 queries[i] = [Li, Ri]。 对于每个查询 i,请你计算从 Li 到 Ri 的 XOR 值(即 arr[Li] xor arr[Li+1] xor ... xor arr[Ri])作为本次查询的结果。 并返回一
阅读全文
摘要:You are given sequence a1, a2, ..., an of integer numbers of length n. Your task is to find such subsequence that its sum is odd and maximum among all
阅读全文
摘要:Mike and some bears are playing a game just for fun. Mike is the judge. All bears except Mike are standing in an n × m grid, there's exactly one bear
阅读全文
摘要:Right now she actually isn't. But she will be, if you don't solve this problem. You are given integers n, k, A and B. There is a number x, which is in
阅读全文
摘要:Vasya has a multiset ss consisting of nn integer numbers. Vasya calls some number xx nice if it appears in the multiset exactly once. For example, mul
阅读全文
摘要:The on-board computer on Polycarp's car measured that the car speed at the beginning of some section of the path equals v1 meters per second, and in t
阅读全文
摘要:Tanya wants to go on a journey across the cities of Berland. There are nn cities situated along the main railroad line of Berland, and these cities ar
阅读全文
摘要:This is the easy version of this problem. The only difference is the constraint on kk — the number of gifts in the offer. In this version: k=2k=2. Vas
阅读全文
摘要:Consider a sequence of digits of length 2k2k [a1,a2,…,a2k][a1,a2,…,a2k]. We perform the following operation with it: replace pairs (a2i+1,a2i+2)(a2i+1
阅读全文
摘要:#include <iostream> #include <vector> #include <algorithm> #include <string> #include <set> #include <queue> #include <map> #include <sstream> #includ
阅读全文
摘要:You are given a system of pipes. It consists of two rows, each row consists of nn pipes. The top left pipe has the coordinates (1,1)(1,1) and the bott
阅读全文
摘要:It is the middle of 2018 and Maria Stepanovna, who lives outside Krasnokamensk (a town in Zabaikalsky region), wants to rent three displays to highlig
阅读全文

浙公网安备 33010602011771号