• 2025-03-19Codeforces Round 1008 (Div. 2)
    A.FinalVerdict题目大意给你一个数组a,每次把他拆分为等长的k个子序列,然后用子序列的平均数替换掉这个子序列,问最后能不能让数组只剩下一个数字x解题思路无论怎么划分,最后的总值是不变的,所以只需要看总和是不是n*x即可代码实现#include<bits/stdc++.h>usingi64=lon
  • 2025-03-19Educational Codeforces Round 176
    A.ToZero#include<bits/stdc++.h>usingnamespacestd;intmain(){ ios::sync_with_stdio(false); cin.tie(0); intT; cin>>T; while(T--) { intn,k; cin>>n>>k; intans=0; if(n%2==1) { n-=k; ans++; } k--;
  • 2025-03-192025湖南多校2
    Dashboard-2025HunanMulti-SchoolTrainingRound2-CodeforcesD排序后从中间向两边取。I,J,B,H参考博客:https://www.cnblogs.com/lyrrr/p/18780739Problem-K-Codeforces给定长度为\(n\)的序列\(a\),\(a_i\)表示有\(i\)个中子的原子可以释放\(a_i\)的能量,一个
  • 2025-03-18Codeforces 1793C. Dora and Search
    题目链接:https://codeforces.com/problemset/problem/1793/Ctimelimitpertest:1second;memorylimitpertest:256megabytesAsyouknow,thegirlDoraisalwayslookingforsomething.Thistimeshewasgivenapermutation,andshewantstofindsuchasubse
  • 2025-03-18Codeforces 2025年1月
    \(CF808E\)https://www.luogu.com.cn/problem/CF808E题解:考虑只有\(2,3\)类型的情况,只需枚举先将\(2,3\)类型物品分别按价值从大到小排序,然后做前缀和,枚举\(2\)类型物品数量即可。再考虑加入\(1\)类型物品的影响,若\(1\)类型物品个数为偶数,将其两两拼接看出\(2\)类型物品即可。若
  • 2025-03-17VP Educational Codeforces Round 35 (Rated for Div. 2)
    A.NearestMinimums题意:求相隔最近的两个最小的数。记录上一个出现的位置,遍历即可。点击查看代码voidsolve(){intn;std::cin>>n;std::vector<int>a(n);for(inti=0;i<n;++i){ std::cin>>a[i];}intmin=*std::min_e
  • 2025-03-17补题Codeforces Round 962 (Div. 3) Decode
    题意:我们需要算所有l,r组合区间中的x,y组合使得0的数量等于1的数量。思路:1.暴力显然不可得,容易想到计算(x,y)的贡献,最后乘上所在区间即可;2.这里我们将0视为-1,只要前后前缀和的值相等即可判断01数量相等,即sum[x-1]==sum[y];(用哈希表即可3.现在来求被包含多少个区间内,l的范围是
  • 2025-03-13Codeforces Round 1008 部分题解
    A/C-BreachofFaith题意给定数列\(a_{1,2\cdots2n+1}\)的其中\(2n\)个数字,找到一个\(a\)的原始序列满足:\(a_i\geq1\),所有元素互不相同且\(a_1=a_2-a_3+a_4-a_5+\cdots+a_{2n}-a_{2n+1}\)。题解设给定数组为\(b\),将最大值设为\(a_1\),其余值从大到小排序后设为
  • 2025-03-11Codeforces Round 1008 (Div. 2)
    后面更新EProblem-D-Codeforces思路贪心,对于都是加或者都是乘的情况,放在哪一侧在当前步对答案的贡献都是一样的,但是却可能导致在以后不优所有不如把此处的贡献暂存起来,等遇到别的情况需要时再决策放在当前步更优的一侧Codestructnode{charc1;inta;c
  • 2025-03-07C++,codeforces 2057B
    //codeforces2057B#include<iostream>#include<utility>#include<set>#include<map>#include<numeric>structcmp{booloperator()(conststd::pair<int,int>&a,conststd::pair<int,int>&b)const{
  • 2025-03-07Codeforces Round 1007 (Div. 2)
    A.ThePlayNeverEnds题目大意ABC三人比赛,谁输谁下场,任何一人2连胜都要下场,问第1次比赛的观众能不能是第k次比赛的观众解题思路简单打表即可发现答案为k%3==1的时候是代码实现#include<bits/stdc++.h>usingi64=longlong;intmain(){std::ios::sync_with_
  • 2025-03-05Rando Note #8: Future training plans
    Iwilltrytoassigntitlestotheserandonotesfromnowon.Fromnowon,Iwillmakeweeklysummaries,thenumberofrandonoteswillincreasedramatically,sothisshouldbebeneficialtomeinsortingthepostsefficiently.Iwillalsotrytousethe
  • 2025-03-04Codeforces Round 479 (Div. 3)
    比赛截图:总体上这场比赛应该算div3中偏下的水平,除了图论和f的优化,其他的感觉还好。题A:WrongSubtraction该题思路:暴力求解:将n进行k次处理,个位不为0时,n-1;个位为0时,n除10解题代码:#include<bits/stdc++.h>usingll=longlong;usingnamespacestd;#defineNOcout<<"NO"<<e
  • 2025-03-03Codeforces Round 479 (Div. 3)
    比赛链接A.WrongSubtraction给一个数n,俩操作执行k次:个位不为0就减1个位为0就除10直接模拟,代码:#include<bits/stdc++.h>usingnamespacestd;intmain(){intn,k;cin>>n>>k;while(k--){if(n%10!=0)n--;elsen/=10;}cout<<n
  • 2025-03-03VP Educational Codeforces Round 22
    A.TheContest题意:有\(n\)个数的和\(sum\),在\(m\)的个区间里如果\(l_i\leqsum\leqr_i\)则输出\(sum\),否则如果\(l_i\geqsum\),输出\(l_i\)。点击查看代码voidsolve(){intn;std::cin>>n;std::vector<int>a(n);for(inti=0;i<n;
  • 2025-03-01Codeforces Round 817 (Div. 4)题解ABCDEFG
    Problem-A-Codeforces题意:输入一个字符串,请判断这个字符串是不是字符串 Timur 的一种排列。例如:Timur ,miurT ,Trumi ,mriTu 都是正确的排列。思路:模拟即可//CodeStartHere intt; cin>>t; while(t--){ intn; cin>>n; strings; cin>>s; m
  • 2025-03-01Codeforces Round 1007 (Div. 2) D1. Infinite Sequence (Easy Version)
    CodeforcesRound1007(Div.2)题目链接
  • 2025-03-01Codeforces Round 1007 (Div. 2)
    “度义而后动,是而不见可悔故也。”如果没有把握,就再检查一下;如果有把握,就自信的提交吧,有什么好担忧的呢?A.ThePlayNeverEnds#include<bits/stdc++.h>usingnamespacestd;intmain(){ ios::sync_with_stdio(false); cin.tie(0); intT; cin>>T; while(T--) { i
  • 2025-03-01Educational Codeforces Round 175 (Rated for Div. 2) D. Tree Jumps
    D.TreeJumps题目链接
  • 2025-03-01Codeforces Round 1007 (Div. 2) 比赛记录
    CodeforcesRound1007(Div.2)比赛记录比赛链接很喜欢的一场比赛,题目质量很高,不是手速场,做出题超级有成就感,赛时切掉了A-D1,上大分了。B卡得有点久,其实是一个很常用的构造手法但一开始没想到。过题记录:A.ThePlayNeverEnds题意大概就是,每场两个人打,一个人观战。如
  • 2025-03-01Codeforces Round 1007 (Div. 2)
    A.ThePlayNeverEnds题意:三个人比赛,每场两个人比赛,另一个人在观众席,观众席替换输的人,但如果有一个人以及连续上场两次,就得下场,让其它两个人比。求第一场比赛在观众席的人在第\(k\)场是不是也能在观众席。找规律,模拟一下发现第二三场不得不上台,然后第四场下台,就这样一直循环
  • 2025-02-28Codeforces Round 1006 (Div. 3) 补题+题解
    A.NewWorld,NewMe,NewArray贪心的想每次都赋值一个\(p\)如果正好和为\(k\)则答案就是\(k/p\),否则是\(k/p+1\)。#include<bits/stdc++.h>usingnamespacestd;#defineintlonglongconstintN=1e6+10;voidsolve(){ intn,k,p; cin>>n>>k
  • 2025-02-28codeforces,2071D,D. For Wizards, the Exam Is Easy, but I Couldn't Handle It
    /*codeforces,2071D,D.ForWizards,theExamIsEasy,butICouldn'tHandleIt一个数组中的逆序对是指一对数i,j(i<j)满足arr[i]>arr[j]给定一个数组,可进行一次操作,将数组中的一段子数组中头部的数移动到尾部,其它数向前移动,例如选定下标l,r的子数组,将arr[l]移动到ar
  • 2025-02-28Educational Codeforces Round 175 (Rated for Div. 2)(ABC D未补)
    EducationalCodeforcesRound175(RatedforDiv.2)(ABC)赛时AB,C没看出来A给出n,求0-n中有多少个\sum_{i=0}^{n}(i%3==i%5)首先,对于最小公倍数,则有n/15*3个,3的倍数,5的倍数,15的倍数除此以外则只需计算其他的数即可voidsolve(){intn;cin>>n;intcnt=n/15*
  • 2025-02-28关于此题Codeforces Round 1003 (Div. 4)_G. Skibidus and Capping
    记录解决这道题过程中先后的疏忽#include<bits/stdc++.h>usingnamespacestd;longlongt;constlonglongN=2e5+10;longlongn,a[N],ans;longlongPrime[N],tot,pos[N],p[N];longlongsum[N],num,h[N];boolvis[N],v[N];voidwork(){for(long