链接: https://codeforces.com/contest/1185/problem/D 题意: A sequence a1,a2,-,ak is called an arithmetic progression if for each i from 1 to k elements satisfy the condition ai=a1+c⋅(i−1) for some fixed c. For example, these five sequences are arithmetic…
A.B 略,相信大家都会做 ^_^ C. Exam in BerSU 题意 给你一个长度为 \(n\) 的序列 \(a_i\) .对于每个 \(i\in [1,N]\) 求 \([1,i-1]\) 中删去至少多少个数能满足剩余 \([1,i]\) 中数的和小于 \(M\) . \(n\le 2\cdot 10^5, M\le 2\cdot 10^7, a_i\le 100\) . Solution 看到值域 \(\le 100\) ,直接用桶记每个数出现多少次,然后从大到小暴力扫一遍桶就做完了.…
题目链接: http://codeforces.com/contest/889/problem/C 题意: 给你 \(n\)和 \(k\). 让你找一种全排列长度为\(n\)的 \(p\),满足存在下标 \(i\),\(p_i\)大于所有 \(p_j\),\(j\epsilon[1,i-1]\)同时大于所有\(p_i\),\(j\epsilon[i+1,i+k]\).问你满足这样条件的排列有多少种? 题解: 设\(dp[i]\)表示以 \(i\) 结尾的,满足题目要求的\(1\) ~ \(i\)…
B. Email from Polycarp 题目链接:http://codeforces.com/contest/1185/problem/B 题目: Methodius received an email from his friend Polycarp. However, Polycarp's keyboard is broken, so pressing a key on it once may cause the corresponding symbol to appear more…
A. Ropewalkers 题目链接:http://codeforces.com/contest/1185/problem/A 题目: Polycarp decided to relax on his weekend and visited to the performance of famous ropewalkers: Agafon, Boniface and Konrad. The rope is straight and infinite in both directions. At…
有点菜,只写出了三道.活不多说,上题开干. A. Ropewalkers Polycarp decided to relax on his weekend and visited to the performance of famous ropewalkers: Agafon, Boniface and Konrad. The rope is straight and infinite in both directions. At the beginning of the performance…
链接: https://codeforces.com/contest/1185/problem/C2 题意: The only difference between easy and hard versions is constraints. If you write a solution in Python, then prefer to send it in PyPy to speed up execution time. A session has begun at Beland Stat…
链接: https://codeforces.com/contest/1185/problem/B 题意: Methodius received an email from his friend Polycarp. However, Polycarp's keyboard is broken, so pressing a key on it once may cause the corresponding symbol to appear more than once (if you press…
链接: https://codeforces.com/contest/1185/problem/A 题意: Polycarp decided to relax on his weekend and visited to the performance of famous ropewalkers: Agafon, Boniface and Konrad. The rope is straight and infinite in both directions. At the beginning o…
题目:http://codeforces.com/contest/1185/problem/G1 题意:给你n给选项,每个选项有个类型和价值,让你选择一个序列,价值和为m,要求连续的不能有两个相同的类型,相同的物]品不一样的顺序代表不同,问有多少个序列 思路:首先范围是15个,这里我们可以用状压来代表选择哪些物品,然后这里是说不能有连续相同的类型,这里我们贪心考虑不全,最开始我考虑的是组合数的插空法,当时 发现有很多细节,写不了,这样的话我们就只能改成dp, 我们设置dp[i][j]   代表i…