Code: #include<cstdio> #include<cstring> #include<algorithm> #include<vector> #include<queue> using namespace std; const int maxn=103; const int maxd=1005; const int maxc=maxd*10; const int sigma=28; char A[maxd][maxd],B[maxn
题目链接 http://codeforces.com/problemset/gymProblem/100703/I Description standard input/outputStatements As a matter of fact, Dragon knows what Prince is interested in now. Prince uses to spend his rare off days learning different courses and trainings.
Problem 1072: The longest same color grid Time Limits: 1000 MS Memory Limits: 65536 KB 64-bit interger IO format: %lld Java class name: Main Description There are n grid, m kind of color. Grid number 1 to N, color number 1 to M. The color of
Bob’s Race Time Limit: 5000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Problem Description Bob wants to hold a race to encourage people to do sports. He has got trouble in choosing the route. There are N houses and N - 1 roads
Signals of most probably extra-terrestrial origin have been received and digitalized by The Aeronautic and Space Administration (that must be going through a defiant phase: "But I want to use feet, not meters!"). Each signal seems to come in two
King George has recently decided that he would like to have a new design for the royal graveyard. The graveyard must consist of several sections, each of which must be a square of graves. All sections must have different number of graves. After a con
题目链接 Problem Description Alice are given an array A[1..N] with N numbers. Now Alice want to build an array B by a parameter K as following rules: Initially, the array B is empty. Consider each interval in array A. If the length of this interval is le
尺取+枚举,推出公式以后就是一个枚举加尺取 但是这题的尺取不是对一个值尺取,而是在一个区间内,所以固定左边界,尺取右边界即可 #include<bits/stdc++.h> #define maxn 100005 #define ll long long using namespace std; int t,n,m,k,x,y,z,l,tot; ll cnt,sum[maxn]; int a[maxn]; ll solve(ll L,ll R){//求区间[l,R)内i+j的和 ll ans=
因为没有初始化ans搞了一晚上 还是尺取,枚举所有l 然后寻找对应满足条件的r,这个串可以被后面所有的串包含,所以每个l 的贡献就是len-r+1 #include<bits/stdc++.h> using namespace std; #define ll long long int main(){ int t,k,len,r,sum; ll ans=; ]; ]; scanf("%d",&t); while(t--){ memset(vis,,sizeof vi
Bound Found Time Limit: 5000MS Memory Limit: 65536K Total Submissions: 1651 Accepted: 544 Special Judge Description Signals of most probably extra-terrestrial origin have been received and digitalized by The Aeronautic and Space Administration