07 2021 档案
摘要:Problem Description One day, a zombie came to the Lawn of the Dead, which can be seen as an n×m grid. Initially, he stood on the top-left cell, which
阅读全文
摘要:A You are given 𝑛n integers 𝑎1,𝑎2,…,𝑎𝑛a1,a2,…,an. Find the maximum value of 𝑚𝑎𝑥(𝑎𝑙,𝑎𝑙+1,…,𝑎𝑟)⋅𝑚𝑖𝑛(𝑎𝑙,𝑎𝑙+1,…,𝑎𝑟)max(a
阅读全文
摘要:Problem Description Little Rabbit is a college student who is studying Communication Engineering. In this term, he has a course called Digital Image P
阅读全文
摘要:Problem Description Kanade is designing a mini-game. It's a puzzle game that orders players to get out of a maze. Players should also collect as many
阅读全文
摘要:Problem Description This summer, ZXyang became so tired when doing the problems of Multi-University contests. So he decided to attend the Unified Nati
阅读全文
摘要:链接:https://ac.nowcoder.com/acm/contest/11255/E 来源:牛客网 题目描述 Bob has a tree with nn nodes and the weight of i-th node is wiwi. But Bob forgot w1...nw1..
阅读全文
摘要:Problem Description Pixels in a digital picture can be represented with three integers (R,G,B) in the range 0 to 255 that indicate the intensity of th
阅读全文
摘要:Problem Description Alice and Bob are playing a game. In this game, there are n straight lines on the 2D plane. Alice will select exactly k straight l
阅读全文
摘要:Problem Description Chenjb is struggling with data stucture now. He is trying to solve a problem using segment tree. Chenjb is a freshman in programmi
阅读全文
摘要:链接:https://ac.nowcoder.com/acm/contest/11255/F 来源:牛客网 题目描述 Alice and Bob are playing a game. At the beginning, there is an undirected graph GG with nn
阅读全文
摘要:链接:https://ac.nowcoder.com/acm/contest/11255/I 来源:牛客网 题目描述 For a sequence t1...nt1...n, we define the weight of it is the number of pairs (i,j)(i,j) s
阅读全文
摘要:链接:https://ac.nowcoder.com/acm/contest/11255/C 来源:牛客网 题目描述 Let LCS(s1,s2)LCS(s1,s2) denote the length of the longest common subsequence (not necessary
阅读全文
摘要:链接:https://ac.nowcoder.com/acm/contest/11255/J 来源:牛客网 题目描述 Bob has an n×mn×m matrix WW. This matrix is very special, It's calculated by two sequences
阅读全文
摘要:链接:https://ac.nowcoder.com/acm/contest/11254/B 来源:牛客网 题目描述 Goodeat has a white chessboard with n rows and m columns. Each grid (i, j) has a weight c(i
阅读全文
摘要:如果边权不大(1e6以下)的话可以不直接sort而是使用桶排序,开边权范围的vector数组不断往对应的vector里push_back边即可
阅读全文
摘要:链接:https://ac.nowcoder.com/acm/contest/11254/E 来源:牛客网 题目描述 Given n, count the number of pairs of positive integers (x, y), such that xy+1∣x2+y2,1≤x≤y≤
阅读全文
摘要:链接:https://ac.nowcoder.com/acm/contest/11254/J 来源:牛客网 题目描述 Goodeat finds an undirected complete graph with n vertices. Each edge of the graph is paint
阅读全文
摘要:Problem Description Give you a cube with a side length of n-1. Find the number of equilateral triangles with three points on the cube point. Each side
阅读全文
摘要:题目描述 给定一棵nn个点的带权树,结点下标从11开始到NN。寻找树中找两个结点,求最长的异或路径。 异或路径指的是指两个结点之间唯一路径上的所有边权的异或。 输入格式 第一行一个整数NN,表示点数。 接下来 n−1n−1 行,给出 u,v,wu,v,w ,分别表示树上的 uu 点和 vv 点有连边
阅读全文
摘要:Problem Description Given a sequence of integers of length n, find the shortest consecutive subsequence witch XOR sum not less than k. If there are mu
阅读全文
摘要:Problem Description Let’s call a weighted connected undirected graph of n vertices and m edges KD-Graph, if the following conditions fulfill: * n vert
阅读全文
摘要:Problem Description Given n-1 points, numbered from 2 to n, the edge weight between the two points a and b is lcm(a, b). Please find the minimum spann
阅读全文
摘要:Problem Description Given a matrix of n rows and m columns,find the largest area submatrix which is non decreasing on each column Input The first line
阅读全文
摘要:链接:https://ac.nowcoder.com/acm/contest/11253/K 来源:牛客网 题目描述 ZYT had a magic permutation a1,a2,⋯ ,ana1,a2,⋯,an, and he constructed a sequence b1,b2,⋯bnb
阅读全文
摘要:链接:https://ac.nowcoder.com/acm/contest/11253/F 来源:牛客网 题目描述 ZYT and ZFeT are great PUAs and both have two girlfriends,but they never think that their g
阅读全文
摘要:Kobolds are rat-like, candle-loving cave folk, digging deep beneath the surface for millennia. Today, they gather together in a queue to explore yet a
阅读全文
摘要:链接:https://ac.nowcoder.com/acm/contest/11213/C 来源:牛客网 题目描述 小F对杨辉三角颇有研究,他把杨辉三角第nn行的数提出来,从左到右分别为a[0],a[1],...,a[n−1]a[0],a[1],...,a[n−1]。 现在他想知道∑i=0n−1i
阅读全文
摘要:链接:https://ac.nowcoder.com/acm/contest/11213/I 来源:牛客网 题目描述 在游戏中,因为一次错误的决断,你的士兵被敌方实行围剿。为了挽回人员损失,你不得不开启金手指暂停敌方士兵的移动,从而尽量让自己的士兵能成功突围。 已知地图是一块n×mn×m的区域,每块
阅读全文
摘要:链接:https://ac.nowcoder.com/acm/contest/11213/F 来源:牛客网 题目描述 在中国象棋中正所谓新手玩车,熟手玩炮,老手玩马,由此可见象棋中炮的地位还是比较高的。 给定一个n×mn×m的棋盘,全部摆满炮,我们视所有炮都不属于同一阵营,他们之间可以相互攻击但不能
阅读全文
摘要:链接:https://ac.nowcoder.com/acm/contest/11213/E 来源:牛客网 题目描述 有nn名选手会进行mm次比赛,每次比赛不会出现平局的情况,只会有一个胜者。在每次比赛完成之后,我们视胜者选手的实力比败者选手的实力强,如果出现选手AA打败选手BB,选手BB打败选手C
阅读全文
摘要:链接:https://ac.nowcoder.com/acm/contest/11213/B 来源:牛客网 题目描述 给定22个由小写字母和问号组成的字符串aa与bb,问号代表你想要的任何字符。 请你找出最短的字符串ss,要求ss包含aa和bb两个字符串,你只需要输出ss的长度即可。 输入描述: 第
阅读全文
摘要:问题描述 X 校最近打算美化一下校园环境。前段时间因为修地铁,X 校大门外种的行道树全部都被移走了。现在 X 校打算重新再种一些树,为校园增添一抹绿意。 X 校大门外的道路是东西走向的,我们可以将其看成一条数轴。在这条数轴上有 n 个障碍物,例如电线杆之类的。虽然障碍物会影响树的生长,但是障碍物不一
阅读全文
摘要:题目描述 XOR(异或)是一种二元逻辑运算,其运算结果当且仅当两个输入的布尔值不相等时才为真,否则为假。 XOR 运算的真值表如下(11 表示真, 00 表示假): 而两个非负整数的 XOR 是指将它们表示成二进制数,再在对应的二进制位进行 XOR 运算。 譬如 1212 XOR 99 的计算过程如
阅读全文
摘要:Suppose you have two points 𝑝=(𝑥𝑝,𝑦𝑝)p=(xp,yp) and 𝑞=(𝑥𝑞,𝑦𝑞)q=(xq,yq). Let's denote the Manhattan distance between them as 𝑑(𝑝,𝑞)=|𝑥𝑝−�
阅读全文
摘要:直接装好mysql后在终端输入mysql -u root -p后会报错command not found,原因就是还没有添加环境变量。 cd ~ open .zshrc 添加: PATH="$PATH":/usr/local/mysql/bin source .zshrc
阅读全文
摘要:#include <bits/stdc++.h> using namespace std; int n, k; void process() { int r; cin >> r; if(r == 1) return; for(int i = 1; i < n; i++) { cout << (i ^
阅读全文
摘要:AquaMoon had 𝑛n strings of length 𝑚m each. 𝑛n is an odd number. When AquaMoon was gone, Cirno tried to pair these 𝑛n strings together. After makin
阅读全文
摘要:AquaMoon has 𝑛n friends. They stand in a row from left to right, and the 𝑖i-th friend from the left wears a T-shirt with a number 𝑎𝑖ai written on
阅读全文
摘要:Cirno gave AquaMoon a chessboard of size 1×𝑛1×n. Its cells are numbered with integers from 11 to 𝑛n from left to right. In the beginning, some of th
阅读全文
摘要:给定一位研究者论文被引用次数的数组(被引用次数是非负整数)。编写一个方法,计算出研究者的 h 指数。 h 指数的定义:h 代表“高引用次数”(high citations),一名科研人员的 h 指数是指他(她)的 (N 篇论文中)总共有 h 篇论文分别被引用了至少 h 次。且其余的 N - h 篇论
阅读全文
摘要:链接:https://ac.nowcoder.com/acm/contest/10662/A 来源:牛客网 We call a matrix "01 Square" if and only if it's a N×NN×N matrix and its elements are all 00 or
阅读全文
摘要:题目描述 有一个球形空间产生器能够在 nn 维空间中产生一个坚硬的球体。现在,你被困在了这个 nn 维球体中,你只知道球面上 n+1n+1 个点的坐标,你需要以最快的速度确定这个 nn 维球体的球心坐标,以便于摧毁这个球形空间产生器。 输入格式 第一行是一个整数 nn (1<=N=10)(1<=N=
阅读全文
摘要:#include <bits/stdc++.h> using namespace std; int n; int x[200005], y[200005], xr[200005]; int main() { int t; cin >> t; while(t--) { cin >> n; for(in
阅读全文
摘要:On a strip of land of length 𝑛n there are 𝑘k air conditioners: the 𝑖i-th air conditioner is placed in cell 𝑎𝑖ai (1≤𝑎𝑖≤𝑛1≤ai≤n). Two or more ai
阅读全文
摘要:大家都知道 Fibonacci 数列吧,f1=1,f2=1,f3=2,f4=3,…,fn=fn−1+fn−2。 现在问题很简单,输入 n 和 m,求 fn 的前 n 项和 Snmodm。 输入格式 共一行,包含两个整数 n 和 m。 输出格式 输出前 n 项和 Snmodm 的值。 数据范围 1≤n
阅读全文
摘要:链接:https://ac.nowcoder.com/acm/contest/11176/B 来源:牛客网 题目描述 A + B ProblemA + B Problem 往往是大家在各Online JudgeOnline Judge通过的第一道题目,刚刚学会写程序的嘟嘟也不例外。然而,单纯的读入两
阅读全文
摘要:链接:https://ac.nowcoder.com/acm/contest/11176/C 来源:牛客网 题目描述 某个国家的货币体系里有 nn 种面值不同的纸币,从小到大面值分别是 a1,a2,...,ana1,a2,...,an,a1=1a1=1。 当取款人去 ATMATM 机取款 cc 元的
阅读全文
摘要:1711. 大餐计数 难度中等83收藏分享切换为英文接收动态反馈 大餐 是指 恰好包含两道不同餐品 的一餐,其美味程度之和等于 2 的幂。 你可以搭配 任意 两道餐品做一顿大餐。 给你一个整数数组 deliciousness ,其中 deliciousness[i] 是第 i 道餐品的美味程度,返回
阅读全文
摘要:代码为pip install powerline-status,系统版本Catalina 15.7 解决:pip换为pip3即可
阅读全文
摘要:被墙的问题,参考https://blog.csdn.net/huangpin815/article/details/105606135
阅读全文
摘要:重载为成员函数 双目: class ClassName { public: DataType operator@(Parameter List); … }; DataType ClassName::operator@ (Parameter List) { … } aa@bb //or aa . op
阅读全文