Avito Code Challenge 2018】的更多相关文章

Codeforces Avito Code Challenge 2018 D. Bookshelves 题目连接: http://codeforces.com/contest/981/problem/D Description Mr Keks is a typical white-collar in Byteland. He has a bookshelf in his office with some books on it, each book has an integer positive…
Portal A. Antipalindrome 暴力. B. Businessmen Problems 暴力. C. Useful Decomposition 居然不是C打头的?! 将一棵树划分成若干条边不相交的路径,使得任意两个路径均有交点. 易知树上的两条路径最多有一个交点.若有三条路径两两相交,则必形成三个交点或一个交点.设路径1与路径2交于\(v_1\),路径1与路径3交于\(v_2\),路径2与路径3交于\(v_3\).若\(v_1\neq v_2 \neq v_3\),则有路径\(…
再次作死的打了一次cf的修仙比赛感觉有点迷.. 还好掉的分不多(原本就太低没法掉了QAQ) 把会做的前三道水题记录在这.. A: Antipalindrome emmmm...直接暴力枚举 code: //By Menteur_Hxy #include <cstdio> #include <iostream> #include <algorithm> #include <cstring> using namespace std; int n,ans; cha…
第一次打CF,很菜,A了三道水题,第四题好像是是数位DP,直接放弃了.rateing从初始的1500变成了1499,还是绿名,这就很尴尬.之后觉得后面的题目也没有想象的那么难(看通过人数)过两天吧剩下的五题给补上. http://codeforces.com/contest/981 A:给你一个字符串S,求把这个字符串中的最长不回文子序列. 思路: 如果S不回文,那就是本身 如果S回文: (1)如果S由一种字母构成,那么最长不回文子序列为空,因为无论删除多少个都是回文串. (2)如果S不是上述情…
C. Useful Decomposition time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Ramesses knows a lot about problems involving trees (undirected connected graphs without cycles)! He created a new us…
A. Antipalindrome 还以为是什么神dp结果就是分情况讨论啊 原串是一串一样的字符的话输出0,是回文串的话输出n-1,否则直接输出原串长度 #include<iostream> #include<cstdio> #include<cstring> using namespace std; const int N=55; int n; char s[N]; int main() { scanf("%s",s+1); n=strlen(s+…
题目链接:http://codeforces.com/contest/981/problem/G 题目大意: 有n个初始为空的‘魔法’可重集,向一个‘可重集’加入元素时,若该元素未出现过,则将其加入:否则该可重集中所有元素的个数都会翻倍. 例如将$2$加入${1,3}$会得到${1,2,3}$,将$2$加入${1,2,3,3}$会得到${1,1,2,2,3,3,3,3}$. $q$次操作,每次操作要么向一个区间内的所有可重集加入某个元素,要么询问一个区间内可重集的大小之和. $n,q ≤ 2×1…
传送门:http://codeforces.com/contest/1081/problem/E E. Missing Numbers time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Chouti is working on a strange math problem. There was a sequence of nn …
传送门:http://codeforces.com/contest/1081/problem/C C. Colorful Bricks time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output On his free time, Chouti likes doing some housework. He has got one new…
传送门:http://codeforces.com/contest/1081/problem/B B. Farewell Party time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Chouti and his classmates are going to the university soon. To say goodbye…