08 2021 档案
摘要:挺nt的一个题,除了嗯模拟没想到更好的办法...大概就是每次遍历一遍所有的进程的当前通信,如果 可以收发则直接收发,然后更新当前通信;如果所有进程都不能收发则死锁。细节见代码。 #include <bits/stdc++.h> using namespace std; int t, n; struc
阅读全文
摘要:76. 最小覆盖子串 难度困难1312 给你一个字符串 s 、一个字符串 t 。返回 s 中涵盖 t 所有字符的最小子串。如果 s 中不存在涵盖 t 所有字符的子串,则返回空字符串 "" 。 注意: 对于 t 中重复字符,我们寻找的子字符串中该字符数量必须不少于 t 中该字符数量。 如果 s 中存在
阅读全文
摘要:Problem Description Let's define the sum of all digits in x as g(x). For example, g(123)=1+2+3=6. Give you a function: f(x)=Ax2g(x)+Bx2+Cxg2(x)+Dxg(x)
阅读全文
摘要:Problem Description Pty has a string S of length n consisting of lowercase English letters. He denotes the value of string T as the number of occurren
阅读全文
摘要:题目背景 这是个非常经典的主席树入门题——静态区间第 kk 小。 数据已经过加强,请使用主席树。同时请注意常数优化。 题目描述 如题,给定 nn 个整数构成的序列 aa,将对于指定的闭区间 [l,r][l,r] 查询其区间内的第 kk 小值。 输入格式 第一行包含两个整数,分别表示序列的长度 nn
阅读全文
摘要:题目描述 给定一个字符串 ss,定义它的 k*k* 前缀 prekpre**k 为字符串 s1…ks1…k,k*k* 后缀 sufksuf**k 为字符串 s∣s∣−k+1…∣s∣s∣s∣−k+1…∣s∣,其中 1≤k≤∣s∣1≤k≤∣s∣。 定义 Border(s)Borde****r(s) 为对
阅读全文
摘要:Problem Description You are required to put n straight lines on a plane, guaranteeing no three lines share a common point and no lines are coincident.
阅读全文
摘要:Problem Description TI10 and ICPC World Finals 2020, which will be held earlier? Take a bet! The International(TI) is the biggest and most prestigious
阅读全文
摘要:链接:https://ac.nowcoder.com/acm/contest/11261/F 来源:牛客网 题目描述 You are now the coordinator for the Nonexistent Old Railway Station! The Nonexistent Old Ra
阅读全文
摘要:Moamen was drawing a grid of 𝑛n rows and 109109 columns containing only digits 00 and 11. Ezzat noticed what Moamen was drawing and became interested
阅读全文
摘要:链接:https://ac.nowcoder.com/acm/contest/11260/E 来源:牛客网 题目描述 There are n cities in the volcano country, numbered from 1 to n. The city 1 is the capital
阅读全文
摘要:Moamen and Ezzat are playing a game. They create an array 𝑎a of 𝑛n non-negative integers where every element is less than 2𝑘2k. Moamen wins if 𝑎1&
阅读全文
摘要:Problem Description As an elegant and accomplished girl, Bella loves watching stars at night (especially the Polaris). There are totally n stars in th
阅读全文
摘要:Problem Description Bob accidentally spilled some drops of ink on the paper. The initial position of the i-th drop of ink is (xi,yi), which expands ou
阅读全文
摘要:Problem Description Alice and Bob are playing a game. They take turns to operate. There are n numbers, a1 , a2 , ... , an. Every time, the player play
阅读全文
摘要:Problem Description Eric is playing a game on an infinite plane. On the plane, there is a circular area with radius r1 called the Scoring Area. Every
阅读全文
摘要:链接:https://ac.nowcoder.com/acm/contest/11256/D 来源:牛客网 题目描述 Given two strings A,BA,B, and little H wants to choose a subsequence from {1,2,⋯ ,∣A∣}{1,2,
阅读全文
摘要:链接:https://ac.nowcoder.com/acm/contest/11259/K 来源:牛客网 题目描述 On a distant planet of dreams, Toilet-Ares is packing up the things and memories, ready to
阅读全文
摘要:链接:https://ac.nowcoder.com/acm/contest/11259/D 来源:牛客网 题目描述 There are two sequences of length n−1n−1, b=(b2,b3,…,bn)b=(b2,b3,…,bn), c=(c2,c3,…,cn)c=(c2
阅读全文
摘要:链接:https://ac.nowcoder.com/acm/contest/11256/J 来源:牛客网 题目描述 There are nn jewels under the sea, and you want to salvage all the jewels. Image that the s
阅读全文
摘要:Soroush and Keshi each have a labeled and rooted tree on 𝑛n vertices. Both of their trees are rooted from vertex 11. Soroush and Keshi used to be at
阅读全文
摘要:在做一道题目的时候需要对C++的set进行二分查找,于是自然而然的使用了std::upper_bound,然而结果是在第36个测试点超时了,改了一天尝试了各种卡常剪枝均没有效果,最后即将要与标程逐字符一致的时候突然发现过了,原因就是标程用的是set自带的upper_bound函数。上网查阅资料发现对
阅读全文
摘要:题目背景 在T市有很多个酒店,这些酒店对于不同种类的食材有不同的需求情况,莱莱公司负责每天给这些酒店运输食材。 由于酒店众多,如何规划运输路线成为了一个非常重要的问题。你作为莱莱公司的顾问,请帮他们解决这个棘手的问题。 题目描述 T市有 N 个酒店,这些酒店由 N−1 条双向道路连接,所有酒店和道路
阅读全文
摘要:Problem Description 给定一张 n×nn×n 的网格图,有些格子能走,有些格子不能走,左上角的格子坐标为 (1,1)(1,1),右下角的格子坐标为 (n,n)(n,n)。 问最多可以找到多少条从 (1,1)(1,1) 到 (n,n)(n,n) 的不相交路径,使得每条路径经过的每个格
阅读全文
摘要:Problem Description 有一个环,环上有 nn 个位置,它们的编号为 1...n1...n。 位置 i(1<i<n)i(1<i<n) 左右两边分别是位置 i−1i−1 和位置 i+1i+1,位置 1 左右两边分别是位置 nn 和位置 2,位置 nn 左右两边分别是位置 n−1n−1
阅读全文
摘要:链接:https://ac.nowcoder.com/acm/contest/11258/H 来源:牛客网 题目描述 xay has an array a of length n, he wants to know how many triples (i, j, k) satisfy ai×aj=a
阅读全文
摘要:链接:https://ac.nowcoder.com/acm/contest/11257/H 来源:牛客网 题目描述 Little Rabbit loves hopping. He always hops around on the grassland. But dangers are lurkin
阅读全文
摘要:题目描述 upd on 2020.6.10 :更新了时限。 作为一个生活散漫的人,小 Z 每天早上都要耗费很久从一堆五颜六色的袜子中找出一双来穿。终于有一天,小 Z 再也无法忍受这恼人的找袜子过程,于是他决定听天由命…… 具体来说,小 Z 把这 NN 只袜子从 11 到 NN 编号,然后从编号 LL
阅读全文
摘要:Banzhuan *Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 262144/262144 K (Java/Others) Total Submission(s): 102 Accepted Submission(s): 36 * Pro
阅读全文
摘要:链接:https://ac.nowcoder.com/acm/contest/11257/F 来源:牛客网 题目描述 Riko is ready to cook hamburger steaks. There are mm pans and nn hamburger steaks that need
阅读全文
摘要:题目描述 小B 有一个长为 nn 的整数序列 aa,值域为 [1,k][1,k]。 他一共有 mm 个询问,每个询问给定一个区间 [l,r][l,r],求: ∑i=1kci2i=1∑kci2 其中 cic**i 表示数字 ii 在 [l,r][l,r] 中的出现次数。 小B请你帮助他回答询问。 输入
阅读全文
摘要:题目描述 Petr likes to come up with problems about randomly generated data. This time problem is about random permutation. He decided to generate a random
阅读全文
摘要:题目描述 HH 有一串由各种漂亮的贝壳组成的项链。HH 相信不同的贝壳会带来好运,所以每次散步完后,他都会随意取出一段贝壳,思考它们所表达的含义。HH 不断地收集新的贝壳,因此,他的项链变得越来越长。 有一天,他突然提出了一个问题:某一段贝壳中,包含了多少种不同的贝壳?这个问题很难回答…… 因为项链
阅读全文
摘要:链接:https://ac.nowcoder.com/acm/contest/11256/B 来源:牛客网 题目描述 There're nn boxes in front of you. You know that each box contains a ball either in white o
阅读全文
摘要:链接:https://ac.nowcoder.com/acm/contest/11256/K 来源:牛客网 题目描述 Given nn integers a1,a2,⋯ ,ana1,a2,⋯,an and mm queries. For each query, you are given a con
阅读全文