Codeforces Round #427 (Div. 2) - B】的更多相关文章

s <= c是最骚的,数组在那一维开了10,第八组样例直接爆了- - /* CodeForces 835C - Star sky [ 前缀和,容斥 ] | Codeforces Round #427 (Div. 2) 题意: 有一片 100*100 的星空,上面有 n 颗星星,每个星星有一个亮度,且在 0~C 范围内周期性变化,现在给出 q 个查询,每个查询给出时间和一个矩形,求在该时间时矩形内星星的亮度和. c <= 10 分析: 由于 c <= 10,则星星的亮度只有11种情况,全部…
证明在Tutorial的评论版里 /* CodeForces 835D - Palindromic characteristics [ 分析,DP ] | Codeforces Round #427 (Div. 2) 题意: 定义 k 回文串满足: 1. 左右子串相等 2. 左右子串为k-1回文串 1 回文串 就是回文串 问你字符串s的子串的每阶回文子串的数目 分析: 研究一下可以发现 k 回文串的要求等价于 1. 本身是回文串 2. 左右子串是k-1回文串 然后可以dp了,还有一个结论是: 若…
Palindromic characteristics of string s with length |s| is a sequence of |s| integers, where k-th number is the total number of non-empty substrings of s which are k-palindromes. A string is 1-palindrome if and only if it reads the same backward as f…
The Cartesian coordinate system is set in the sky. There you can see n stars, the i-th has coordinates (xi, yi), a maximum brightness c, equal for all stars, and an initial brightness si (0 ≤ si ≤ c). Over time the stars twinkle. At moment 0 the i-th…
Two boys decided to compete in text typing on the site "Key races". During the competition, they have to type a text consisting of s characters. The first participant types one character in v1 milliseconds and has ping t1 milliseconds. The secon…
引子: A题过于简单导致不敢提交,拖拖拉拉10多分钟还是决定交,太冲动交错了CE一发,我就知道又要错过一次涨分的机会.... B题还是过了,根据题意目测数组大小开1e5,居然蒙对,感觉用vector更好一点... C题WA第9组,GG思密达....明天起床再补C吧 - - 题目链接: http://codeforces.com/contest/835/problem/B B. The number on the board Some natural number was written on t…
A. Key races 题目链接:http://codeforces.com/contest/835/problem/A 题目意思:两个比赛打字,每个人有两个参数v和t,v秒表示他打每个字需要多久时间,等这个这个字传递过去需要t秒,而且在打第一个字之前也会有一个反应时间t.问第一个人可不可以获胜. 题目思路:这个题目当时题目没读懂,明白之后就是一个非常简单的题目了. (s*v1+2*t1)<(s*v2+2*t2)第一个人就可以获胜 (s*v1+2*t1)==(s*v2+2*t2) 就会平局,否…
http://codeforces.com/contest/835 A.拼英语水平和手速的签到题 #include <bits/stdc++.h> using namespace std; int s, v1, v2, t1, t2; int main() { cin >> s >> v1 >> v2 >> t1 >> t2; int a1 = t1 + v1 * s + t1; int a2 = t2 + v2 * s + t2;…
[Link]:http://codeforces.com/contest/835/problem/D [Description] 给你一个字符串; 让你在其中找到1..k阶的回文子串; 并统计它们的数量 如果一个字符串是一个回文串,则它可以是1阶子串; k阶字符串,要求它的左边和右边都是k-1阶子串; [Solution] bo[i][j]表示i..j这一段是否为回文; 可以用O(n2)的复杂度处理出整个bo数组; 然后O(n2)枚举每一段区间; 算出这个区间的字符串最大可以是一个几阶字符串记为…
[Link]:http://codeforces.com/contest/835/problem/A [Description] [Solution] 傻逼题. [NumberOf WA] [Reviw] [Code] #include <bits/stdc++.h> using namespace std; #define int long long int n,v1,v2,t1,t2; main(){ scanf("%lld%lld%lld%lld%lld",&…