Codeforces Round #411 B. 3-palindrome】的更多相关文章

C. Make Palindrome Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/600/problem/C Description A string is called palindrome if it reads the same from left to right and from right to left. For example "kazak", "oo&q…
A. Fake NP time limit per test:1 second memory limit per test:256 megabytes input:standard input output:standard output Tavak and Seyyed are good friends. Seyyed is very funny and he told Tavak to solve the following problem instead of longest-path.…
题目链接:http://codeforces.com/contest/600/problem/C C. Make Palindrome time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output A string is called palindrome if it reads the same from left to right an…
B. 3-palindrome time limit per test 1 second memory limit per test 256 megabytes   In the beginning of the new year Keivan decided to reverse his name. He doesn't like palindromes, so he changed Naviek to Navick. He is too selfish, so for a given n h…
比赛时候切了A-E,fst了A Standings第一页只有三个人挂了A题,而我就是其中之一,真™开心啊蛤蛤蛤 A. Fake NP time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Tavak and Seyyed are good friends. Seyyed is very funny and he told Tavak…
A Fake NP standard input/output s, MB Submit Add to favourites x3673 B -palindrome standard input/output s, MB Submit Add to favourites x3760 C Find Amir standard input/output s, MB Submit Add to favourites x3503 D Minimum number of steps standard in…
题目大意:给出一个森林,每次询问给出u,v,问从u所在连通块中随机选出一个点与v所在连通块中随机选出一个点相连,连出的树的直径期望(不是树输出-1).(n,q<=10^5) 解法:预处理出各连通块的直径和各点到连通块内一点的最远距离d[x](树形dp+换根),询问若在同一块内输出-1,否则若随机选出两点x,y,直径为max(d[x]+d[y]+1,x所在块直径,y所在块直径),我们把同一连通块内的d排序,枚举小的连通块中的d,到大的连通块中二分d[x]+d[y]+1<=max(x所在块直径,y…
来自FallDream的博客,未经允许,请勿转载,谢谢. 由于人傻又菜 所以这次又滚去div2了  一堆结论题真的可怕 看见E题不是很有思路   然后就去大力搞F题  T了最后一个点 真的绝望   但是还是上紫了 感觉每次cf都在乱打 我好菜啊都不会 A.Fake NP 给定l和r,求[l,r]中的数的因数中出现次数最多的那一个 sb题 如果l和r相同输出它 不然输出2 #include<iostream> #include<cstdio> #include<cstring&…
D. Minimum number of steps time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output We have a string of letters 'a' and 'b'. We want to perform some operations on it. On each step we choose one of s…
A. Fake NP 题意:给你l,r,让你输出[l,r]里面除1以外的,出现因子数量最多的那个数. 题解:如果l==r输出l,否则都输出2 #include<bits/stdc++.h> using namespace std; int main(){ int l,r; cin>>l>>r; if(r-l==0){ cout<<l<<endl; return 0; } int ans = 0; int num = 0; for(int i=2;…