Codeforces Round 1000 (Div. 2)(前三题)

Codeforces Round #694 (Div. 1 + Div2)(A ~ H,8题全,超高质量题解)【每日亿题】2021/2/1、2/2 寒假每日训练2021/1/21 每日亿题 这套Div2 好简单呀,我写了不到两个小时就快AK了… 阅读详情

A. Minimal Coprime

翻译:

        如果 l 和 r 互为同素数,则正整数 [l,r] 的一段称为同素段。

        如果一个共素数段 [l,r] 不包含任何不等于它本身的共素数段,那么这个共素数段 [l,r] 就叫做最小共素数段。为了更好地理解这句话,可以参考注释。

        给定正整数段 [l,r],求 [l,r] 中包含的最小共素数段的个数。

思路:

题目要求不同整数段之间不能为包含关系。

对于一个整数x与x+1必定为互素。

因此答案为r-l+1(l与r都不为1)

实现:

#include<bits/stdc++.h>
using namespace std;
using ll = long long;
// using pll = pair<ll,ll>;

void solve(){
  int a,b;
  cin>>a>>b;
  int ans = 0;
  if (a==1&&b==1){
    cout<<1<<endl;
    return ;
  }
  if (a==1){
    ans+=1;
    a++;
  }
  cout<<ans+(b-a)<<endl;
}

int main(){
    ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    // 不使用科学计数法
    // cout<<fixed;
    // 中间填保留几位小数,不填默认
    // cout.precision();
    int t;cin>>t;
    while (t--) solve();
}

B. Subsequence Update

 翻译:

        给你一个整数序列 a_{1},a_{2},...,a_{n},和一个线段 [l,r](1≤l≤r≤n)。

        你必须对这个序列执行下面的操作一次。

  • 选择序列 a 的任意子序列,并反转它。注意,子序列不一定要连续。

        形式上,选择任意数量的下标i_{1},i_{2},...,i_{k},使得 1\leq i_{1}\leq i_{2}\leq ... \leq i_{k}\leq n。然后,将所有 1≤x≤k 的第 i_{x}个元素同时改为第 i_{k-x+1}个元素的原始值。

求操作后 a_{l}+a_{l+1}+...+a_{r-1}+a_{r} 的最小值。

思路:

对于这只能一次的反转,可以选择要求段的左边的小值与要求段的大值交换。或要求段的右边的小值与要求段的大值交换。注意只能选一边,因为只能反转一次。

实现:

#include<bits/stdc++.h>
using namespace std;
using ll = long long;
// using pll = pair<ll,ll>;

void solve(){
  int n,l,r;
  cin>>n>>l>>r;
  ll res = 0;
  vector<int> a(n+1);
  for (int i=1;i<=n;i++) cin>>a[i];
  priority_queue<int> tmpl_ans,tmpr_ans;
  priority_queue<int,vector<int>,greater<int>> lans,rans; 
  for (int i=l;i<=r;i++){
    res += a[i];
    tmpl_ans.push(a[i]);
    tmpr_ans.push(a[i]);
  } 
  for (int i=1;i<l;i++){
    lans.push(a[i]);
  }  
  for (int i=r+1;i<=n;i++){
    rans.push(a[i]);
  }  
  ll res1 = res;
  while (!lans.empty()){
    int now1 = tmpl_ans.top(),now2 = lans.top();
    if (now1>now2){
      res -= now1-now2;
      tmpl_ans.pop();
      tmpl_ans.push(now2);
      lans.pop();
    }else{
      break;
    }
  }
  while (!rans.empty()){
    int now1 = tmpr_ans.top(),now2 = rans.top();
    if (now1>now2){
      res1 -= now1-now2;
      tmpr_ans.pop();
      tmpr_ans.push(now2);
      rans.pop();
    }else{
      break;
    }
  }
  cout<<min(res1,res)<<endl;
}

int main(){
    ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    // 不使用科学计数法
    // cout<<fixed;
    // 中间填保留几位小数,不填默认
    // cout.precision();
    int t;cin>>t;
    while (t--) solve();
}

C. Remove Exactly Two

 翻译:

        给您一棵有 n 个顶点的树。您必须准确执行以下操作两次。

  • 选择一个顶点 v;
  • 删除 v 所带的所有边,同时删除顶点 v。

        请找出精确执行两次操作后的最大连通部分数。

        当且仅当存在一条从 x 到 y 的路径时,两个顶点 x 和 y 位于同一个连通组件中。
 根据定义,0 个顶点的图有 0 个连通成分。

思路:

记录每个点的度数,并从度数大层数的开始遍历。

那么答案有两种情况:

  1. 点a的度数+点b的度数-1      a与b不相连
  2. 点a的度数+点b的度数-2      a与b相连

实现:

#include<bits/stdc++.h>
using namespace std;
using ll = long long;

void solve(){
  int n;    
  cin>>n;
  // 记录每个点的度数
  vector<int> dus(n+1,0);
  // 创建邻接表
  vector<vector<int>> edge(n+1);
  for (int a,b,i=1;i<n;i++){
    cin>>a>>b;
    dus[a]++;
    dus[b]++;
    edge[a].push_back(b);
    edge[b].push_back(a);
  }
  // 记录每个度数所包含的点
  map<int,vector<int>> mp;
  for (int i=1;i<=n;i++) mp[dus[i]].push_back(i);
  
  // 考虑到有的度数只有一个点增加记录点
  int f=0,f_du = 0;
  // 按度数从大到小遍历
  for (auto iter=mp.rbegin();iter!=mp.rend();iter++){
    int du = iter->first;
    auto nums = iter->second;
    int num_size = nums.size();
    if (f){
      for (int i:nums){
        // 两个点不相连
        if (find(edge[i].begin(),edge[i].end(),f)==edge[i].end()){
          cout<<du+f_du-1<<endl;
          return;
        }
      }
      cout<<du+f_du-2<<endl;
      return;
    }else{
      if (num_size==1){
        f = nums[0];
        f_du = du;
      }else{
        for (int i=0;i<num_size;i++){
          for (int j=i+1;j<num_size;j++){
            // 两个点不相连
            if (find(edge[nums[i]].begin(),edge[nums[i]].end(),nums[j])==edge[nums[i]].end()){
              cout<<2*du-1<<endl;
              return;
            }
          }
        }
        cout<<2*du-2<<endl;
        return;
      }
    }
  }
}

int main(){
    ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    // 不使用科学计数法
    // cout<<fixed;
    // 中间填保留几位小数,不填默认
    // cout.precision();
    int t;cin>>t;
    while (t--) solve();
}

                                                                                              有建议可以评论,我会积极改进qwq。

学Simulink--基础微电网场景实例:基于Simulink的微电网黑启动过程建模与仿真 黑启动(Black Start)是指在全系统停电(无电压、无频率)状态下,微电网依靠内部电源自主恢复供电的能力。🌩️典型场景主网长时间故障自然灾害导致区域停电计划检修后重启❗挑战无参考电压/频率 → 逆变器无法锁相负荷逐级投入 → 需避免过流/过压多电源协调 → 防止环流或失步✅黑启动成功标准在30 秒内恢复关键负荷供电电压/频率稳定在范围内无设备损坏或保护跳闸🎯本文目标:手把手教你使用 Simulink + Simscape + Stateflow 搭建。 阅读详情

相关推荐

inferCNVpy实战指南:从安装到肿瘤细胞识别

本文提供inferCNVpy实战指南,详细介绍了从环境安装、数据准备到核心CNV推断分析的完整流程。重点讲解了如何利用该工具从单细胞转录组数据中识别肿瘤细胞,包括参考细胞选择、参数调优、结果可视化与解读,并分享了关键的避坑技巧,帮助用户高效完成肿瘤细胞识别。

weixin_29079643的博客 428

Ethflow Round 1 (Codeforces Round 1001, Div. 1 + Div. 2)(前三题)

在一次操作中,您可以从 s 中选择一个非空的子序列 t,使得 t 中任何两个相邻的字符都是不同的。然后,翻转 t 中的每个字符(0 变为 1,1 变为 0)。要让过程永续下去必须要走过每个点,判断是否存在一个点 i 会在以该点为起点,向左来回或向右来回时消失,判断条件为i<=2*max(i-1,n-i)。如果某个时钟的时间在某一秒内为 0,即使您可以移动到该时钟并在该秒内重置其时间,您仍然会输。dfs(tmp)为当前序列tmp的最大值,tmp可能会有重复计算的情况,使用memo记忆化。都是 s 的子序列。

qq_68286180的博客 1396

uniapp+openlayers集成天地图实战:renderjs通信陷阱与性能优化避坑指南

本文深入探讨了uniapp与openlayers集成天地图时的renderjs通信陷阱与性能优化策略。通过实战案例解析了renderjs的特殊通信机制、地图实例生命周期管理、图层懒加载等关键技巧,帮助开发者避免常见坑点,提升应用流畅度。特别针对多语言切换、热重载偏移等疑难问题提供了解决方案,是uniapp+openlayers开发者的实用避坑指南。

weixin_30872157的博客 365

Ethflow Round 1 (Codeforces Round 1001, Div. 1 + Div. 2)(A-E1)

新年好,最近有点忙了,过几天再把D题补上.....于2025/2/6补上D题

Vcoistnt的博客 1383

Librepilot _64位window10环境下的搭建及一些坑的解决办法

  刚入IT行业的小菜鸟,在window上折腾了四天的librepilot地面控制站的搭建,想着这么辛苦不能白费了,看网上相关资料少得可怜,唯一一个详细教程还是在32位环境下,一大堆坑,所以把自己的经验写下来,供大家一起参考。 参考的原文是:https://www.cnblogs.com/jasonchan1202/p/7809937.html的博客,但是执行下来才发现这个博客对64位系统极其不...

weixin_41426339的博客 2730

PID详解

1、什么是PID及其作用 设定一个输出目标,反馈系统传回输出值,如与目标不一致,则存在一个误差,PID 根据此误差调整输入值,直至输出达到设定值. 为什么需要PID呢,比如控制温度,我们需要设置一个要达到的目标温度值,当将温度稳定在目标温度值 例如,我们希望水的目标温度值为70°,其希望无非就是可以快速而且无抖动的达到70°,并稳定在70° 如果我们使用普通的方式加热,当温度到达70°后就以及停止加热,岂不是简单快速,当然用在要求不高的场合也可以,但是如果要求更高的场合呢,会出现温度到达70°后......

weixin_48435215的博客 5万+

Codeforces Round 1008 (Div. 2)(A-D)

补题

Vcoistnt的博客 1435

避开RK3588开发板SDIO配置的坑:O9201SB WiFi模组接入实战指南

本文为嵌入式开发者提供了在RK3588开发板上,利用TF卡槽接入O9201SB WiFi6模组的实战指南。文章深度剖析了SDIO配置中常见的电源管理序列冲突问题,并给出了从设备树节点修改、内核编译到系统验证的完整解决方案,帮助开发者避开配置陷阱,成功实现高性能无线连接。

sprite的博客 954

Codeforces Round 1000

Codeforces Round 1000

青少年趣味编程 1079

【招商银行笔试题汇总】[全网首发]2024-04-23-招商银行春秋招笔试题-三语言题解(CPP/Python/Java)

🏳️ 难难难!!!本次招商银行的笔试算是今年春招最难的场次之一了K小姐所在的公司有 NNN 个部门,编号从 111 到 NNN。由于公司网络系统比较老旧,对于同一个数据 ddd,不同部门记录的值可能不同。数据 ddd 在各部门被记录为 d1,d2,...,dNd_1, d_2, ..., d_Nd1​,d2​,...,dN​。公司提出可以通过会议来实现数据的一致性。每次会议会让相邻编号范围内的所有部门一起参加,如果有超过半数的部门能够对数据 ddd 的值达成共识,那么在此次会议后,参与会议的所有部门会将

春秋招笔试突围 3474

第一章:信号链的精度之战:深入解决电流采样偏差

摘要:本文深入探讨了FOC控制中电流采样偏差问题及其解决方案。电流采样偏差主要来源于偏移误差、增益误差、非线性误差和温漂四大类,其中偏移误差对FOC性能影响最为严重。硬件方面建议采用高精度采样电阻、低失调运放和独立基准电压等设计;软件层面提出了上电自动零点校准、在线实时补偿和模型闭环补偿三种策略。最后介绍了量产自动化校准系统,通过硬件优化和软件补偿相结合,确保每台产品电流采样精度的一致性,为FOC控制奠定坚实基础。

汽车软件开发 610

Codeforces Round 1000 (Div. 2)(A-D)

wa了几发不然能上大分来着

Vcoistnt的博客 1086

图机器学习(2)——图的可视化

图结构可通过图形化方式直观呈现。节点通常用圆形表示,边则用连接线表示。然而当节点和边数量增加时,绘制清晰的图形表示可能会变得相当困难,这主要源于节点在二维坐标系中的布局问题。对于包含数百个节点的图,手动指定每个节点的坐标显然不切实际。在本节中,我们将介绍如何在不指定每个节点坐标的情况下绘制图形。我们将利用两种不同的解决方案:networkx 和 Gephi。

盼小辉丶的博客 9062

Codeforces Round 963 (Div. 2)

Codeforces Round 963 (Div. 2) A—C题详解

闻道有先后,术业有专攻 1501

SAP B1中文培訓教材_SDK

公司内部培训资料,对开发工具 ,DIAPI, UIAPI,Add-ON有详细解说

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

Codeforces Round 965 (Div. 2)(A-C)

A,B都是构造,像是构造专场能上分真开心,最后C题差一点没搞出来,外界大脑得以拿下。

2301_76888784的博客 1368

华为的C语言编程规范.pdf

华为技术有限公司内部技术规范。本规范制定了编写C语言程序的基本原则、规则和建议。从代码的清晰、简洁、可测试、安全、程序效率、可移植各个方面对C语言编程作出了具体指导。

Codeforces Round 961 (Div. 2)(A~D)

因此我们对于每一个位置,只需要将最大的那个集合设为不可选,然后最终将大集合中的所有小集合同步更新即可。枚金币买尽可能多的价格少的那一种花,然后再用剩下的钱买尽可能多的价格多的那一种花。因此我们只需要从后往前遍历所有位置,然后统计哪些集合是没法选的,最终在剩下的集合中选一个所含字母最少的即可。,接下来我们只需要求最多可以执行多少次这样的操作即可,然后便可以求出最大的花瓣数。然后,我们可以通过放弃价格少的一种花,再购买价格多的那一种花,使得所得到的花瓣加。贪心,先将占有单元格最多的对角线填满,然后依次往下填。

weixin_61825750的博客 1884

汉书HE8,好用的汇编代码编写工具

汉书HE8,好用的汇编代码编写工具早期编写汇编代码所用功能强大

Codeforces Round 1039(Div.2)

文章摘要:分享了A、B、C三题的解题思路:A题采用贪心算法处理排序后的小于等于k的元素;B题用双指针模拟LR操作避免连续四个单调元素;C题通过分析元素递增关系判断是否能通过特定操作得到目标数组。作者认识到自身不足,决心加强练习。

豪德又AC啦 1768

Codeforces Round 1000 (Div. 2)

Codeforces Round 1000 (Div. 2) A B C D

udiandianis的博客 992

Codeforces Round 1019

Codeforces Round 1019

青少年趣味编程 1749

Codeforces Round 983 (Div. 2)(A~E)

上分

weixin_61825750的博客 1532

Codeforces Round #625 -前三题题解

文章目录A. Contest for Robots题意:很简单就不写了思路:代码1代码2B. Journey Planning题意:思路:代码:C. Remove Adjacent题意:思路:关于这道题目:反思:代码: Codeforces Round #625 (Div. 2, based on Technocup 2020 Final Round)-A. Contest for Robots ...

不想起标题 643

Codeforces Round 1024

Codeforces Round 1024

青少年趣味编程 1524

Codeforces Round 943 (Div. 3 ABCDEFG1G2题) 视频讲解

Codeforces Round 943 (Div. 3)(A ~ G2 视频讲解)

Edward Shi的博客 1843

Codeforces Round 953 (Div. 2) (A~F)(冒充Div2)

思路:很经典的将区间操作转化成端点操作,首先考虑全部修改,然后可以发现对比于区间修改而言,只有区间最靠左的两个数跟区间最靠右的两个数可能会不一样,因此只需要关注区间的左右四个点即可,若区间长度小于4的我们直接特判。思路:分类讨论,首先若后面的选举人存在比当前选举人票数多的情况,那么必然是将前面所有的人全部排除,然后再看票数是否大于后面最大的票,若还是小,则将后面票数最多的人也排除掉。的图,所有的斜率为-1的线上所有的顶点全部连通(1除外,需要特判)。总上,我们需要统计的是,删去前。个人的票小于他的最小。

weixin_61825750的博客 1894

Codeforces Round 1037(Div.3)

文章摘要:本文记录了Codeforces Div.3比赛的解题思路和代码实现。A题通过字符串处理快速找到数位最大值;B题模拟数组遍历,维护计数器num;C题分析塔楼传送与水位上升的相对关系;D题通过自定义排序更新金币数量;E题通过GCD和LCM验证数组构造的合理性。每道题都提供了赛时代码和详细解题分析,展现了对基础算法和思维题的掌握。

豪德又AC啦 1391

Codeforces Round 1050 (Div. 4)

摘要 本文包含五个编程竞赛题解: A. Sublime Sequence:给定整数x和n,构造交替为x和-x的序列(如x,-x,x,...),根据n的奇偶性计算序列总和:奇数时和为x,偶数时为0。 B. Lasers:在存在n条水平激光和m条垂直激光的平面上,从(0,0)到(x,y)的最少穿越次数为n+m次,因为无法避开激光,必须沿边缘行走。 C. Pacer(未完整):Farmer John参加Pacer测试,每分钟可选择跑向对面(得1分)或停留。问题描述不完整,未给出具体解法。 每个问题都配有C++代码

豪德又AC啦 1294
上一篇: Codeforces Round 997 (Div. 2)(前四题)
下一篇: python虚拟环境创建
Cando-01
博客等级 码龄5年 310粉丝 76原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Cando-01

随心而动,随性而为。

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值
⌂ 换网址