Codeforces Round #194 (Div. 1) / 333B Chips(贪心+代码优化)

【图像大模型】RIFE实战:如何通过中间流估计实现4K视频的实时插帧优化 本文深入解析了基于深度学习的RIFE视频插帧算法,重点探讨其核心的中间流估计技术如何实现高效精准的帧生成。通过实战教程,详细介绍了针对4K视频的实时处理优化方案,包括环境配置、参数调优及性能瓶颈分析,帮助用户利用消费级显卡将低帧率视频转化为流畅的高帧率体验。 阅读详情

B. Chips
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

Gerald plays the following game. He has a checkered field of size n × n cells, where m various cells are banned. Before the game, he has to put a few chips on some border (but not corner) board cells. Then for n - 1 minutes, Gerald every minute moves each chip into an adjacent cell. He moves each chip from its original edge to the opposite edge. Gerald loses in this game in each of the three cases:

  • At least one of the chips at least once fell to the banned cell.
  • At least once two chips were on the same cell.
  • At least once two chips swapped in a minute (for example, if you stand two chips on two opposite border cells of a row with even length, this situation happens in the middle of the row).

In that case he loses and earns 0 points. When nothing like that happened, he wins and earns the number of points equal to the number of chips he managed to put on the board. Help Gerald earn the most points.

Input

The first line contains two space-separated integers n and m (2 ≤ n ≤ 1000, 0 ≤ m ≤ 105) — the size of the field and the number of banned cells. Next m lines each contain two space-separated integers. Specifically, the i-th of these lines contains numbers xi and yi (1 ≤ xi, yi ≤ n) — the coordinates of the i-th banned cell. All given cells are distinct.

Consider the field rows numbered from top to bottom from 1 to n, and the columns — from left to right from 1 to n.

Output

Print a single integer — the maximum points Gerald can earn in this game.

Sample test(s)
input
3 1
2 2
output
0
input
3 0
output
1
input
4 3
3 1
3 2
3 3
output
1
Note

In the first test the answer equals zero as we can't put chips into the corner cells.

In the second sample we can place one chip into either cell (1, 2), or cell (3, 2), or cell (2, 1), or cell (2, 3). We cannot place two chips.

In the third sample we can only place one chip into either cell (2, 1), or cell (2, 4).



简单贪心,考虑相邻的两条边即可,详见代码。


完整代码:(未优化)

/*92ms,0KB*/

#include<cstdio>

bool isban[2][1000];

int main()
{
	int n, m, x, y, count = 0;
	scanf("%d%d", &n, &m);
	while (m--)
	{
		scanf("%d%d", &x, &y);
		isban[0][x] = true;
		isban[1][y] = true; ///只统计相邻的两条边就行
	}
	for (int i = 2; i < n; ++i)
	{
		if (!isban[0][i])
			count++;
		if (!isban[1][i])
			count++;
	}
	///在这种情况下两个chips(芯片/小木片)重合,上面多算了一次count
	if (n & 1 && !(isban[0][(n + 1) >> 1] || isban[1][(n + 1) >> 1]))
		count--;
	printf("%d", count);
	return 0;
}

优化版:

/*62ms,0KB*/

#include<cstdio>

bool isban[2][1000];

int main()
{
	int n, m, x, y;
	scanf("%d%d", &n, &m);
	int count = (n << 1) - 4;
	isban[0][1]=true;
	isban[0][n]=true;
	isban[1][1]=true;
	isban[1][n]=true;
	while (m--)
	{
		///只统计相邻的两条边就行
		scanf("%d%d", &x, &y);
		if (!isban[0][x])
		{
			--count;
			isban[0][x] = true;
		}
		if (!isban[1][y])
		{
			--count;
			isban[1][y] = true;
		}
	}
	///在这种情况下两个chips(芯片/小木片)重合,上面多算了一次count
	if (n & 1 && !(isban[0][(n + 1) >> 1] || isban[1][(n + 1) >> 1]))
		--count;
	printf("%d", count);
	return 0;
}



Seedance2.5本地部署指南:从环境配置到生产优化的完整实践 在 AI 内容生成领域,本地部署方案正逐渐成为开发者和技术团队关注的焦点。Seedance2.5 作为一款支持图像和视频生成的 AI 工具,其完全离线运行的能力解决了云端服务在数据隐私、使用成本和访问稳定性方面的痛点。对于需要处理敏感内容、频繁生成素材或希望完全掌控生成流程的技术人员来说,掌握本地部署方法具有实际价值。 本文将以 Seedance2.5 的本地部署为例,详细介绍从环境准备、依赖配置到运行验证的完整流程,同时深入分析关键参数配置、常见问题排查方法以及生产环境下的优化建议。通过实际部署过程,理解 阅读详情

相关推荐

Andriod应用开发基础项目——记账本

本项目采用Java语言编写,是一款基于Android Studio开发的简易项目,本项目可以提高Java语言编写软件的能力,同时加深对开发软件Android studio有了更深层次的掌握,很适合初学者。在项目过程中,遇到了一些挑战和问题,但通过不断的努力和学习,最终取得了成功。未来,可以还可以继续优化App的功能和性能,增加更多实用的功能,提升用户体验。

eryasd的博客 3474

Codeforces 1244F Chips(模拟)

题目链接:Chips 题意:给定一个有n个点环(3<=n<=2*10^5),每个点未黑色或白色,每过一秒当前点会变成自己和周边两个点中颜色最多的点的颜色,问k(问1<=k=10^9)秒后颜色情况; 题解:我们可以发现当一个点周围有至少一个点和自己颜色相同时这个点的颜色就一定不会改变,对于BBBWBWBB 或者BBBWBWBWWW这种类型的每一次变化后中间BWBW....BW就会被左右同化掉一个,而全是BWBW的类型可以通过k的奇偶判断,那么我们就可以先把所有BWBW左右端点存下来暴力更

m0_56280274的博客 230

Super4PCS文章阅读笔记

Super4PCS阅读笔记 Super4PCS阅读笔记 前言 前言 今天给大家分享一下点云配准四点法4PCS0的变种——Super4PCS。此算法的原文在:Super4PCS: Fast Global Pointcloud Registration via Smart Indexing。稍微我也会写一篇关于如何使用这篇文章的里所提供的代码进行点云粗配准。关于四点法...

Vodake的博客 4546

Codeforces Round #194 (Div. 1) - B. Chips(规律)

B. Chips time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Gerald plays the following game. He has a checkered

Mr_Treeeee的博客 711

将Python爬取的数据导入钉钉多维表

摘要:本文介绍将Python爬取的数据导入钉钉多维表的完整解决方案。首先通过requests库爬取数据并解析为结构化格式,然后使用钉钉开放平台API对接多维表。关键步骤包括获取app_key、app_secret等凭证,通过OAuth2获取access_token,以及批量写入记录。文章详细说明了参数获取位置、字段类型匹配、权限配置等注意事项,并提供了错误处理建议和性能优化方法。适用于需要将网络数据同步到钉钉多维表的开发场景。

IT深耕十余载,大道之简 2142

别再只仿真原理图了!用ADS做微带功分器,版图仿真这一步才是关键

本文深入探讨了使用ADS进行微带功分器设计时版图仿真的重要性,指出原理图仿真与版图仿真的本质差异及其对性能的影响。通过详细分析版图效应、关键设置和优化策略,帮助工程师避免常见陷阱,提升设计效率和准确性。文章特别强调了版图仿真在确保微波电路性能中的关键作用。

weixin_42561476的博客 416

Codeforces 92A-Chips

Chips time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output There are n walruses sitting in a circle. All of them

wang_128的博客 699

HSMS/SECS/GEM/GEM300半导体通讯协议介绍

HSMS/SECS/GEM/GEM300半导体通讯协议解决方案介绍 目录 SECS/GEM协议通讯 1 目录 2 1.介绍 3 1.1 产品概述 3 1.1.1 高扩展性 4 1.2 通讯实现 4 1.2.2多主机实现 4 1.3 当前的SEMI标准 5 1.3.1 功能跟友商对比 6 1.4 软件灵活性 7 1.5 无需学习SECS 7 1.6 自定义消息传递 8 1.7 记录收集 8 1.8 SECS Manual文档 8 1.9 产品清单 8 2 产品结构 9 2.1 控制面板 9 2.2 使用环境

semisecs 16万+

Codeforces 92A Chips

#define _CRT_SECURE_NO_WARNINGS #include <iostream> #include <cstdio> #include <math.h> #include <string> #include <algorithm> #include <vector> using namespace s...

Polanwind 247

生成式深度学习(第二版)-第一章-Conda环境下TensorFlow和Keras的安装和配置

按照书籍中的代码运行提示,需要配置Docker。个人的机器上正好有 conda4.14.0,索性就在本地环境进行配置。

GarryWang1248的博客 400

AI 辅助代码审查:开启代码质量管控的智能时代

AI辅助代码审查正在改变传统的代码质量管控方式。通过自动化分析、智能反馈和上下文感知,AI不仅提高了代码审查的效率,还提升了代码质量的一致性和可维护性。随着机器学习和深度学习技术的不断发展,未来AI将成为开发者日常工作中强大的助手,进一步推动软件开发向智能化、自动化方向发展。

这里只有干货:从 Modbus 通信到 MES 对接,从 YOLO 训练到工控机部署,带你搞定工业软件开发全流程。 3234

【codeforce】A. Chips Moving(规律)(~水)

You are givennnchips on a number line. Theii-th chip is placed at the integer coordinatexixi. Some chipscan have equal coordinates. You can perform each of the two following types of moves any (...

Nerdant 623

有效Dk值提取方法的仿真分析

通过本文的仿真对比分析,提取有效Dk值方面,TDR技术在一些固定的场景下,依然有其参考应用价值,而随着VNA功能的不断增强和高精度测量手段的不断更新,双端口Delta-L技术才是主流评估方法,而单端口Delta-L技术则可以作为其降本增效的方案补充。

一只豌豆象的博客 1838

codeforce 333B chips

Gerald plays the following game. He has a checkered field of size n × n cells, where m various cells are banned. Before the game, he has to put a few chips on some border (but not corner) board cells...

gtuif的博客 512

SAP B1中文培訓教材_SDK

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

贝叶斯统计 [韦来生编]

贝叶斯(Bayes)统计是近几十年来迅速发展起来的数理统计的一个重要分支。贝叶斯方法与经典统计方法的主要不同之处是进行统计推断时除了利用样本信息外,还要利用参数的先验信息,因此可以提高统计推断或统计决策的效果。它在经济、金融、生物、医学、自然科学和社会科学等许多领域具有广泛的应用。贝叶斯方法的研究已渗透到了统计学的几乎所有领域。作者在给中国科学技术大学概率论与数理统计专业本科生开设的“数理统计”课程中有一章专门讲授“贝叶斯方法和统计决策理论”,近十年来也给中国科学技术大学概率统计专业研究生开设过几次“贝叶斯分析”课。本书是在对过去讲稿的内容作了适当的增减和调整的基础上完成的。  本书共分六章。第1章是绪论,介绍了贝叶斯统计的若干基本概念,同时对必要的数理统计的基础知识有重点地作了回顾。第二章介绍了确定先验分布的若干可供选择的方法。第三章介绍了几类常见统计模型参数的后验分布的主要结果和计算方法。第四章和第五章分别介绍了“贝叶斯统计推断”和“贝叶斯统计决策”的内容。第六章介绍了贝叶斯统计计算的若干方法,包括蒙特卡洛方法和马尔可夫链蒙特卡洛(MCMC)方法以及相关统计软件的简介。本书的每一章附右大量的例题和习题,书末附有常用的几个表格和部分习题解答供读者查用。  大约可在54学时内讲授本书的第1章至第六章的主要内容,教师可根据学时需要选讲本书第1章至第六章的部分内容。书中标“*”号的章节可略去不讲,留给读者作为阅读材料。第六章例题中的R代码和部分例题的数据文件等可从作者个人主页下载。  作者在编写本书的过程中参考了J.O.Berger教授的《统计决策论及贝叶斯分析》和茆诗松教授编写的《贝叶斯统计》等书中的一些内容,以及《贝叶斯分析》一书中由张伟平博士编写的有关贝叶斯统计计算的一些内容。在此表示衷心感谢。  本书编写准备过程中,中国科学技术大学统计与金融系的几个研究生帮助完成了本书部分中文的录入和排版,作者对他们的辛勤工作表示真诚的感谢。高等教育出版社为本书的出版给予了大力支持。在此一并致谢。

Codeforces Round #194 (Div. 1) / 333A Secrets(贪心)

A. Secrets http://codeforces.com/contest/333/problem/A time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Ge

AC,∑ndless 2041

深度学习工具包 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&#39;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(&#39;DeepLearnToolbox&#39;));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(&#39;state&#39;,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&#39;); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand(&#39;state&#39;,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 = &#39;sigm&#39;;%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, &#39;Too big error&#39;);```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(&#39;state&#39;,0)sae = saesetup([784 100]);sae.ae{1}.activation_function = &#39;sigm&#39;;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)&#39;)% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = &#39;sigm&#39;;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, &#39;Too big error&#39;);```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x&#39;,28,28,60000))/255;test_x = double(reshape(test_x&#39;,28,28,10000))/255;train_y = double(train_y&#39;);test_y = double(test_y&#39;);%% 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&#39;ll get around 1.2% errorrand(&#39;state&#39;,0)cnn.layers = { struct(&#39;type&#39;, &#39;i&#39;) %input layer struct(&#39;type&#39;, &#39;c&#39;, &#39;outputmaps&#39;, 6, &#39;kernelsize&#39;, 5) %convolution layer struct(&#39;type&#39;, &#39;s&#39;, &#39;scale&#39;, 2) %sub sampling layer struct(&#39;type&#39;, &#39;c&#39;, &#39;outputmaps&#39;, 12, &#39;kernelsize&#39;, 5) %convolution layer struct(&#39;type&#39;, &#39;s&#39;, &#39;scale&#39;, 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, &#39;Too big error&#39;);```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(&#39;state&#39;,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, &#39;Too big error&#39;);%% ex2 neural net with L2 weight decayrand(&#39;state&#39;,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, &#39;Too big error&#39;);%% ex3 neural net with dropoutrand(&#39;state&#39;,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, &#39;Too big error&#39;);%% ex4 neural net with sigmoid activation functionrand(&#39;state&#39;,0)nn = nnsetup([784 100 10]);nn.activation_function = &#39;sigm&#39;; % 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, &#39;Too big error&#39;);%% ex5 plotting functionalityrand(&#39;state&#39;,0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = &#39;softmax&#39;; % 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, &#39;Too big error&#39;);%% 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(&#39;state&#39;,0)nn = nnsetup([784 20 10]); nn.output = &#39;softmax&#39;; % 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, &#39;Too big error&#39;);```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

【CF】-Chips(思维)

Chips Gerald plays the following game. He has a checkered field of size n × n cells, where m various cells are banned. Before the game, he has to put a few chips on some border (but not corner) boar...

Greenary的博客 638

pscad IEEE标准系统搭建说明

pscad IEEE标准系统搭建说明,包含典型的IEEE 9节点、14节点、30节点、39节点和118节点系统。内含标准测试系统的原始数据和潮流结果。

Codeforces Problem 333B - Chips

B. Chips time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Gerald plays the following game. He has a checkered

vloai 438

CodeForces333B :Chips (规律,思维)

题目链接---CodeForces33B:ChipsCodeForces333B :Chips 时间限制:1000MS    内存限制:262144KByte   64位IO格式:%I64d &amp; %I64u 描述Gerald plays the following game. He has a checkered field of size n?×?n cells, where m var...

NSSWTT的博客 676

CF 333 B.Chips CodeForces【伪容斥】

Gerald plays the following game. He has a checkered field of size n × n cells, where m various cells are banned. Before the game, he has to put a few chips on some border (but not corner) board cells.

Irish_Moonshine的博客 596

Codeforces Round #333 (Div. 2) B C D

Codeforces Round #333 (Div. 2)B. Approximating a Constant Range題意對於一個長爲n的序列且相臨的兩個數字相差1,求一個最長的區間,區間的最大值和最小值的差爲1。思路考慮dp,序列有三個狀態, 0. 序列的最後一個數字是該序列的最小值 1. 序列是一個全部數字一樣的序列 2. 序列的最後一個數字是該序列的最大值 於是對於a[

xuelanghu407 561

codeforces 1244F.Chips

题目链接:http://codeforces.com/problemset/problem/1244/F 题目大意:有一个黑球和白球串起来的环,如果当前位置是白球,且它的左边一个和右边一个是黑球,那么下一秒这个球变成黑球。白球也是同样的规则,问经过k次之后的状态。 思路:可以发现如果有两个相同的球相连的话,那么就颜色永远不变并且每秒都会往外扩张。每次只要比较黑球和白球谁先扩张到或者都没扩张到的话就...

xiayuccc的博客 254

Codeforces Round #333 (Div. 2)

应该是学ACM以来打的最好的一场了. CF的rating改版以来第一次上DIV1.加油. Codeforces 602A Two Bases 题目链接:http://codeforces.com/problemset/problem/602/A 题意:给你两个进制不同的数字,要求比较大小. 分析:直接把两个数用十进制求出来就好了.需要注意的是不要使用pow函数,pow的返

Fry_guest的专栏 1508

Codeforces Round #333 (Div. 2) B Approximating a Constant Range

题意:求一个最大的区间使最大值与最小值相差不大于1 用multiset暴力做了一发

u014445884的专栏 432

Codeforces Round #333 (Div. 1)

problem C. Kleofáš and the n-thlon 或者601C description: m的全排列随机选n个得到n行m列的矩阵。第j列的得分为该列所有数的和。第j列排名为得分比它小的列数+1。给定该列的n个数,求其排名期望。 solotion:这n个数的为sum,就是说有多少个数的和小于sum。其他m-1个数是无分别的,因此只要求某一列得分小于sum的概率,然后乘以m-1。

grandpi的专栏 717

A - Chips

Gerald plays the following game. He has a checkered field of sizen × ncells, wheremvarious cells are banned. Before the game, he has to put a few chips on some border (but not corner) board cells....

weixin_30727835的博客 206

Codeforces Round #194 (Div.1 + Div. 2)

A. Candy Bags 总糖果数\(\frac{n^2(n^2+1)}{2}\),所以每人的数量为\(\frac{n}{2}(n^2+1)\) \(n\)是偶数。 B. Eight Point Sets 模拟。 C. Secrets 将\(n\)转成3进制数,考虑最后一位非0位,没有刚好\(n\)的数量为非0位的前一位加1,当前位置0,最后将钱都转化为最低单位。 D...

weixin_30918415的博客 143
上一篇: Codeforces Round #173 (Div. 2) / 282A Bit++(模拟)
下一篇: Codeforces Beta Round #75 (Div. 2) / 92B Binary Number(贪心)
synapse7
博客等级 码龄14年 432粉丝 701原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值
⌂ 换网址