
训练合集
文章平均质量分 91
训练记录
SmallKa0
CCPC银牌 ICPC银牌 双非acmer
展开
-
2019-2020 ACM-ICPC Pacific Northwest Regional Contest (Div. 1)
文章目录2019-2020 ACM-ICPC Pacific Northwest Regional Contest (Div. 1)B.Perfect FlushC.Coloring ContentionD.Dividing By TwoE.Rainbow StringsI.Error CorrectionL.Carry Cam FailureM.Maze Connect2019-2020 ACM-ICPC Pacific Northwest Regional Contest (Div. 1)AB原创 2021-11-06 15:00:36 · 317 阅读 · 0 评论 -
Codeforces Global Round 1
2022/3/4文章目录A. ParityB. TapeC. Meaningless OperationsD. JongmahE. Magic StonesF. Nearest LeafA. Parity题意:求n=a1∗bk−1+a2∗bk−2+...+akn=a_1*b^{k-1}+a_2*b^{k-2}+...+a_kn=a1∗bk−1+a2∗bk−2+...+ak的奇偶性。题解:考虑b的奇偶性,若b为偶数,则前k-1项必为偶数,此时只用判断aka_kak奇偶性。若b为奇数,n的原创 2022-03-04 17:09:53 · 373 阅读 · 0 评论 -
Codeforces Round #538 (Div. 2)
Codeforces Round #538 Div.2A.Got Any Grapes?B. Yet Another Array Partitioning TaskC. Trailing Loves (or L'oeufs?)D. Flood FillE. Arithmetic ProgressionF. Please, another Queries on Array?A.Got Any Grapes?题意:由三个人,第一个人需要x个a葡萄,第二个人需要y个a葡萄或b葡萄,第三个人需要z个a,b,c原创 2022-03-06 15:36:09 · 508 阅读 · 0 评论 -
Codeforces Round #776 (Div. 3)
A. Deletions of Two Adjacent LettersB. DIV + MODC. Weight of the System of Nested SegmentsD. Twist the PermutationE. Rescheduling the ExamF. Vitaly and Advanced Useless AlgorithmsG. Counting ShortcutsA. Deletions of Two Adjacent Letters题意:给你一个字符串,一次可以删.原创 2022-03-09 12:07:58 · 2136 阅读 · 0 评论 -
Subpermutation-2021中国大学生程序设计竞赛(CCPC)- 网络选拔赛(重赛)
题意:把所有nnn元排列按字典序从小到大排成一列,求其中有多少子串为mmm元排列,ttt组询问。题解:(1)考虑单个nnn元组中的mmm元组个数。将mmm元组看成一个元素,排列组合有m!m!m!的情况,现在共有(n−m+1)(n-m+1)(n−m+1)个元素,排列组合为(n−m+1)!(n-m+1)!(n−m+1)!。共有m!(n−m+1)!m!(n-m+1)!m!(n−m+1)!的mmm元组。(2)考虑跨两个nnn元组的mmm元组个数。假设kkk为某个排列中的最后一个使得pk<pk+1&原创 2022-03-07 23:18:51 · 389 阅读 · 1 评论 -
Codeforces Round #546 (Div. 2)
@[TOC](Codeforces Round #546 (Div. 2))A.Nastya Is Reading a Book题意:一本书共有nnn章,每章为[li,ri][l_i,r_i][li,ri],现在读到kkk页,问剩下没读得包括当前章的章数。题解:遍历一遍看第kkk页再第几章,ans=n−k+1ans=n-k+1ans=n−k+1int l[111],r[111];int main() { ios::sync_with_stdio(0); cin.tie(0); cout.t原创 2022-03-17 18:56:51 · 561 阅读 · 0 评论 -
2022 HZNU Programing Contest for Sophomore Grade Group
A. Petr题意:给定一个字符串S,问以stat字符串开头,以end字符串结尾的子字符串有多少种,若完全一样视为一种。题解:考虑双哈希,以哈希值来判断字符串相等,可以达到n2n^2n2复杂度。wa点:对于end字符串,他的开头下表jjj应该大于等于stat的开头下标iii并且j+len2−1>=i+len1−1j+len2-1>=i+len1-1j+len2−1>=i+len1−1。然后赛时一直T68,因为开了个map,在否循环里判断map里是否已经有这个合法字符串,这样就多原创 2022-03-05 22:45:06 · 577 阅读 · 0 评论 -
Codeforces Round #775 (Div. 2, based on Moscow Open Olympiad in Informatics)
A. Game题意:你只能跳一次,可以从1的地方跳到任意1的地方,消耗的值为距离差,问最小消耗多少。题解:从前面最后的1跳到后面最前的1.#include <cstdio>#include <cmath>#include <algorithm>#include <iostream>#include <cstring>#include <map>#include <string>#include <原创 2022-03-07 09:41:27 · 530 阅读 · 0 评论 -
Codeforces Round #779 (Div. 2)
Codeforces Round #779 Div.2A.Marin and PhotoshootB.Marin and Anti-coprime PermutationC.Shinju and the Lost PermutationD1.388535 (Easy Version)D2.388535 (Hard Version)E.Gojou and Matrix GameF.Juju and Binary StringA.Marin and Photoshoot题意:有一串01串,0代表男生,1代表原创 2022-03-28 19:45:56 · 1315 阅读 · 0 评论 -
Codeforces Round #539 (Div. 2)
A. Sasha and His TripB. Sasha and Magnetic MachinesC. Sasha and a Bit of RelaxD. Sasha and One More NameF. Sasha and Interesting Fact from Graph TheoryA. Sasha and His Trip题意:从1号城市到n号城市,每过一个城市消耗一升油,在i城市加油的代价为i每升。油箱最多v升油,问到n号城市的最小代价。题解:在最前面几个城市加最多的油,最.原创 2022-03-07 17:04:04 · 192 阅读 · 0 评论 -
ICL 2016
文章目录ICL 2016A Three seamarksD CamelogisticsF GCD and LCMG PotsH MessengerI Manhattan ProjectM The smallest fractionICL 2016ABCD (√)EF (√)G (√)H (√)I (√)JKLM (√)A Three seamarks给出点M1,M2,M3的坐标,和角M1KM2,M2KM3的大小,求点K的坐标D Camelogistics题意:骆驼要把原创 2021-11-05 22:47:50 · 235 阅读 · 0 评论 -
HZNU Winter Training Contest 6
C.Positions in Permutations题意:若∣p[i]−i∣=1|p[i]-i|=1∣p[i]−i∣=1,则这是一个完美位置。问nnn个位置恰好有kkk个完美位置的方案数。设F(m)F(m)F(m)代表固定mmm个完美位置,G(m)G(m)G(m)代表恰好有mmm个完美位置。∑i=0n(−1)i(ni)=0=[n=0]\sum_{i=0}^n(-1)^i\tbinom{n}{i}=0=[n=0]∑i=0n(−1)i(in)=0=[n=0]F(m)=∑i=mn(im)G(i)F原创 2024-05-11 22:46:39 · 732 阅读 · 0 评论 -
ICPC 2019-2020 North-Western Russia Regional Contest
文章目录ICPC 2019-2020 North-Western Russia Regional ContestA.Accurate MovementB.Bad TreapE.EquidistantI.Ideal PyramidJ.Just the Last DigitM.Managing DifficultiesICPC 2019-2020 North-Western Russia Regional ContestA (√)(√)(√)B (√)(√)(√)CDE (√)(√)(√)FG原创 2021-11-07 15:12:25 · 347 阅读 · 0 评论