摘要:题目描述 小N现在有一个字符串S。他把这这个字符串的所有子串都挑了出来。一个S的子串T是合法的,当且仅当T中包含了所有的小写字母。小N希望知道所有的合法的S的子串中,长度最短是多少。 输入描述: 一行一个字符串S。只包含小写字母。S的长度不超过106. 输出描述: 一行一个数字,代表最短长度。数据保
阅读全文
摘要:vector :push_back priority_queue<int,vector<int>,greater<int> >q2; //top 队首最小
阅读全文
摘要:You are a rich person, and you think your wallet is too heavy and full now. So you want to give me some money by buying a lovely pusheen sticker which
阅读全文
摘要:Given a sequence of K integers { N1, N2, ..., NK }. A continuous subsequence is defined to be { Ni, Ni+1, ..., Nj } where 1≤i≤j≤K. T
阅读全文
摘要:只能是0 ,-1,0x3f3f3f3f (1e9)
阅读全文
摘要:unsigned int 0~4294967295 (10位数,4e9) int -2147483648~2147483647 (10位数,2e9 2^31 - 1) long long: -9223372036854775808~9223372036854775807 (19位数, 9e18 )
阅读全文
摘要:D - Xor Sum 2 Time limit : 2sec / Memory limit : 1024MB Score : 500 points Problem Statement There is an integer sequence A of length N. Find the numb
阅读全文
摘要:退到C盘目录下,nslookup 网址 来查询域名shift+鼠标右键 出现在此处打开powershell 窗口,直接进入当前目录 //在文件夹下进入命令行 1.打开文件夹 2.在上面的导航栏中输入CMD,回车即可打开命令提示符 且路径为当前文件夹
阅读全文
摘要:// 任意两点间有唯一路径的无向图是树 //HDU 6446 Tree and Permutation Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s
阅读全文
摘要:1 https://baike.baidu.com/item/%E8%BF%90%E7%AE%97%E7%AC%A6%E4%BC%98%E5%85%88%E7%BA%A7/4752611?fr=aladdin * / % + -
阅读全文
摘要:YJJ's Salesman Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 1383 Accepted Submission(s): 483 P
阅读全文
摘要:1 #include <iostream> 2 #include <cstdio> 3 #include <algorithm> 4 #include <cstdlib> 5 #include <cstring> 6 #include <string> 7 #include <deque> 8 #i
阅读全文
摘要:C. Maximal Intersection time limit per test 3 seconds memory limit per test 256 megabytes input standard input output standard output C. Maximal Inter
阅读全文
摘要:链接:https://www.nowcoder.com/acm/contest/158/A来源:牛客网 q次询问,每次给一个x,问1到x的因数个数的和。 输入描述: 输出描述: 示例1 输入 复制 4 1 2 3 10 输出 复制 1 3 5 27 说明 1的因数有12的因数有1,23的因数有1,3
阅读全文
摘要://hdu 1695 GCD Time Limit: 6000/3000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 15816 Accepted Submission(s): 6095
阅读全文
摘要:// ACM训练联盟周赛 C. Teemo's tree problem There is an apple tree in Teemo's yard. It contains n nodes and n-1 branches, and the node 1 is always the root o
阅读全文
摘要:// hdu 6434 ( Problem I. Count ) Problem I. Count Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 524288/524288 K (Java/Others)Total Submission(s
阅读全文
摘要:1 //N! 2 #include 3 #include 4 #include 5 #define ll long long 6 #define M 100000000 7 #define N 50000//根据数据量选择 8 using namespace std; 9 ll n; 10 ll a[N];//要用ll 11 void solve(ll n) 12 {...
阅读全文
摘要:Teemo likes to drink raspberry juice. He even spent some of his spare time tomake the raspberry juice himself. The way to make the raspberries juice i
阅读全文
摘要:Teemo has a formula and he want to calculate it quickly. The formula is . As the result may be very large, please output the result mod 1000000007. In
阅读全文
摘要:65536K Teemo is very interested in convex polygon. There is a convex n-sides polygon, and Teemo connect every two points as diagonal lines, and he wan
阅读全文
摘要:ACM训练联盟周赛 131072K Teemo decides to use his money to conquer the universe. It is known that there are m planets that humans can reach at present. They
阅读全文
摘要:Almost Sorted Array Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 262144/262144 K (Java/Others)Total Submission(s): 7686 Accepted Submission(s)
阅读全文
摘要:I Count Two Three Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2719 Accepted Submission(s): 11
阅读全文
摘要:A family of nn gnomes likes to line up for a group picture. Each gnome can be uniquely identified by a number 1..n1..n written on their hat. Suppose t
阅读全文
摘要:Consider an n \times mn×m matrix of ones and zeros. For example, this 4 \times 44×4: \displaystyle \begin{matrix} 1 & 1 & 1 & 1 \\ 0 & 1 & 1 & 1 \\ 0
阅读全文
摘要:D. Vasya And The Matrix time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output D. Vasya And The
阅读全文
摘要:int n; int main() { scanf("%d",&n); cout>b == a/(2^b) &&还具有短路的功能,即如果第一个表达式为false,则不再计算第二个表达式 int a[5]; char c ='d'; for(int i=0;i<4;i++) a[i]=i; for(int i=0;i<...
阅读全文
摘要:Balls Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 1196 Accepted: 783 Description The classic Two Glass Balls brain-teaser is often pose
阅读全文
摘要:Consider nn initial strings of lower case letters, where no initial string is a prefix of any other initial string. Now, consider choosing kk of the s
阅读全文
摘要:p1m2 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 925 Accepted Submission(s): 351 Problem De
阅读全文
摘要:Recently, Bob has just learnt a naive sorting algorithm: merge sort. Now, Bob receives a task from Alice.Alice will give Bob N sorted sequences, and t
阅读全文
摘要:C. Elections time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output C. Elections time limit per
阅读全文
摘要:1 如果 x>0&&x&(x-1)==0 那么x为2的指数幂 0&(-1)==0
阅读全文
摘要:题目描述 现在给你N个正整数ai,每个数给出一“好数程度” gi(数值相同但位置不同的数之间可能有不同的好数程度)。对于在 i 位置的数,如果有一在j位置的数满足 j < i 且 ai=aj,则你可以将位于[i,j]闭区间内的序列评为“好序列”,然后获得∑gk(j≤k≤i)(此闭区间内“好数程度”之
阅读全文
摘要:从前在月球上有一个机器人。月球可以看作一个 n*m 的网格图,每个格子有三种可能:空地,障碍,机器人(有且仅有一个),现在地面指挥中心想让机器人在月球上行走,每次可以发送一个指令,为 U-往上走、D-往下走、L-往左走、R-往右走的其中之一。当机器人接收到一个行走指令时,如果即将到达的位置为障碍物,
阅读全文
摘要:Z市是一座港口城市,来来往往的船只依靠灯塔指引方向。在海平面上,存在n个灯塔。每个灯塔可以照亮以它的中心点为中心的90°范围。特別地, 由于特殊限制,每个灯塔照亮范围的角的两条边必须要么与坐标轴平行要么与坐标轴成45°。 由于经费限制,Z市的灯塔只能被点亮一座。你需要求出在这种情况下,是否存在一座灯
阅读全文
摘要:C. The Phone Number time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output C. The Phone Number t
阅读全文
摘要:Ultra-QuickSort Time Limit: 7000MS Memory Limit: 65536K Total Submissions: 70489 Accepted: 26437 Description In this problem, you have to analyze a pa
阅读全文
摘要:敌兵布阵 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 122113 Accepted Submission(s): 51091 Problem
阅读全文
摘要:给定一棵二叉树的后序遍历和中序遍历,请你输出其层序遍历的序列。这里假设键值都是互不相等的正整数。 输入格式: 输入第一行给出一个正整数N(<=30),是二叉树中结点的个数。第二行给出其后序遍历序列。第三行给出其中序遍历序列。数字间以空格分隔。 输出格式: 在一行中输出该树的层序遍历的序列。数字间以1
阅读全文
摘要:Travel Time Limit: 1500/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 4685 Accepted Submission(s): 1535 Proble
阅读全文
摘要:Elven Postman Time Limit: 1500/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 2526 Accepted Submission(s): 1493
阅读全文
摘要:int a[8]={1,2,3,4,5}; int p=lower_bound(a,a+5,6)-a; cout<<p<<endl;//5 set<int>s; set<int>::iterator it; s.insert(3); s.insert(2); s.insert(1); s.inser
阅读全文
摘要:Problem Description Edward is a worker for Aluminum Cyclic Machinery. His work is operating mechanical arms to cut out designed models. Here is a brie
阅读全文
摘要:C. Vasya And The Mushrooms time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output C. Vasya And
阅读全文
摘要:度度熊的字符串课堂开始了!要以像度度熊一样的天才为目标,努力奋斗哦! 为了检验你是否具备不听课的资质,度度熊准备了一个只包含大写英文字母的字符串 A[1,n] = a_1 a_2 \cdots a_nA[1,n]=a1a2⋯an,接下来他会向你提出 qq 个问题 (l,r)(l,r
阅读全文
摘要:调查问卷 Accepts: 1546 Submissions: 6596 Time Limit: 6500/6000 MS (Java/Others) Memory Limit: 262144/262144 K (Java/Others) 调查问卷 Accepts: 1546 Submissions
阅读全文
摘要:It’s universally acknowledged that there’re innumerable trees in the campus of HUST.Now HUST got a big land whose capacity is C to plant trees. We hav
阅读全文
摘要:https://cn.vjudge.net/contest/224070#problem/B
阅读全文
摘要:Problem Description I've sent Fang Fang around 201314 text messages in almost 5 years. Why can't she make sense of what I mean?``But Jesus is here!" t
阅读全文
摘要:The so-called best problem solver can easily solve this problem, with his/her childhood sweetheart. It is known that y=(5+2 *sqrt(6))^(1+2^x) For a gi
阅读全文
摘要:牛客小白月赛5 D 题目描述 输入描述: 输入数据共一行,一个正整数n,意义如“问题描述”。 输出描述: 输出一行描述答案:一个正整数k,表示S的末尾有k个0 示例1 输入 复制 10 输出 复制 7 说明 鸣谢真·dalao Tyxao 1 ll ans=0; 2 scanf("%d",&n);
阅读全文
摘要:Problem Description A sequence Sn is defined as:Where a, b, n, m are positive integers.┌x┐is the ceil of x. For example, ┌3.14┐=4. You are to calculat
阅读全文
摘要:Problem Description There are n apples on a tree, numbered from 1 to n.Count the number of ways to pick at most m apples. Input The first line of the
阅读全文
摘要:2038: [2009国家集训队]小Z的袜子(hose) Description 作为一个生活散漫的人,小Z每天早上都要耗费很久从一堆五颜六色的袜子中找出一双来穿。终于有一天,小Z再也无法忍受这恼人的找袜子过程,于是他决定听天由命……具体来说,小Z把这N只袜子从1到N编号,然后从编号L到R(L 尽管
阅读全文
摘要:65536K Today is a bad day. Teemo is scolded badly by his teacher because he didn't do his homework.But Teemo is very self-confident, he tells the teac
阅读全文