933
  • 2024-07-30Codeforces Round 933 (Div. 3) D 题
    D.RudolfandtheBallGame原题链接:https://codeforces.com/contest/1941/problem/D RudolfandBernarddecidedtoplayagamewiththeirfriends. n peoplestandinacircleandstartthrowingaballtoeachother.Theyarenumberedfrom 1 to nn i
  • 2024-03-18Codeforces Round 933 G. Rudolf and Subway
    原题链接:Problem-G-Codeforces思路:根据题意可知相同颜色的边一定是联通的,那么就可以设置虚点,例如1-2,2-3,3-4边的颜色都是相同的,那么就可以设置一个特殊的点例如设置为10,那么这三条边就可以改成1-10,10-2,2-10,10-3,3-10,10-4,从点到虚点需要1的代价,但是从虚点到其他点不需要代价,
  • 2024-03-17Codeforces Round 933 Rudolf and k Bridges
    原题链接:Problem-E-Codeforces题目大意:给一个行为n列为m的河流二维数组,数字代表河流的深度。题目要求连续建造k座桥,桥的定义是从第一列到第m列,每隔d需要按照支架,安装支架的代价是深度+1。问安装最少需要多少代价?思路:单调队列优化dp,dp数组只需要一维,dp[i]的含义是从1到i建
  • 2024-03-143.14 CF Round 933 (Div. 3)
    (1)CF1941BRudolfand121给定一个长度为\(n\)的序列\(a\)。求最少进行多少次操作后所有\(a_i=0\):选择一个\(2\lei<n\),并让\(a_i\getsa_i-2,a_{i-1}\getsa_{i-1}-1,a_{i+1}\getsa_{i+1}-1\)。我们记选择\(i=x\)时的操作为\(\opera
  • 2024-03-14Codeforces Round 933 (Div. 3)赛后总结
    CodeforcesRound933(Div.3)B从边缘开始计算,因为边缘肯定只能一个一个减,就可以遍历得到答案.代码C只要对mapie特判,然后判断map和pie的个数就是答案了。D(记忆化搜索)可以通过二维数组来标记搜索状态,将已经出现过的状态直接返回,极大减少时间。#include<bits/stdc++.h>
  • 2024-03-14Codeforces Round 933 (Div. 3) A - G 题解
    CodeforcesRound933(Div.3)A-RudolfandtheTicketSolution因为\(n\)很小,直接枚举\(b_i+c_j\)所产生的所有数字Code#include<bits/stdc++.h>usingnamespacestd;voidsolve(){intn,m,k;cin>>n>>m>>k;intans=0;
  • 2024-03-12CF-933(已更新:B-D)
    CF-933当天晚上舍友在玩剧本杀,不得不说那剧情实在是太狗血了,想不通他们是怎么能玩得那么起劲的但也不能当作这次发挥不好的借口/_\A题最开始没看到数据范围(D也是),B一开始就想到了思路,但调了二十多分钟,甚至因为数组开小了白白多了一次RE……D题才是最难绷的,把题看懂后自己就用
  • 2024-03-12Codeforces Round 933 (Div. 3)
    CodeforcesRound933(Div.3)AA-RudolfandtheTicket暴力查看代码voidsolve(){intn,m,k;cin>>n>>m>>k;vector<int>b(n),c(m);for(inti=0;i<n;++i)cin>>b[i];for(inti=0;i<m;++i)cin>>c[i];
  • 2024-03-12Codeforces Round 933 (Div. 3)
    CodeforcesRound933(Div.3)A-RudolfandtheTicket解题思路:暴力。代码:#include<bits/stdc++.h>usingnamespacestd;usingll=longlong;usingpii=pair<ll,ll>;#definefifirst#definesesecondusingpiii=pair<ll,pair<ll,ll>&
  • 2024-03-12Codeforces Round 933 (Div. 3)
    A.RudolfandtheTicket#include<bits/stdc++.h>usingnamespacestd;usingi32=int32_t;usingi64=longlong;usingldb=longdouble;#defineinti64usingvi=vector<int>;usingpii=pair<int,int>;constintinf=1e9;co
  • 2024-03-12Codeforces Round 933 (Div. 3) A-F
    CodeforcesRound933(Div.3)A.RudolfandtheTicket题意:有两个数组\(b_n\)和\(c_m\),两个数组中分别取一个数相加是否小于k,有几种方法使\(b_f\)+\(c_s\)<=k思路:暴力枚举所有方案,时间复杂度O(nm)代码:#include<bits/stdc++.h>usingnamespacestd;constintMAXN=1e