Google Code Jam 2015 Round 1A 解题报告

斯坦福HumanPlus机器人核心技术解析:从HST强化学习框架到HIT模仿学习的实现路径 本文深入解析了斯坦福HumanPlus人形机器人的核心技术实现路径。其核心在于HST强化学习框架与HIT模仿学习架构的协同:HST作为“小脑”,通过rsl_rl框架在仿真中训练稳健的低级运动控制;HIT作为“大脑”,基于改进的Transformer架构学习高级任务规划。文章详细拆解了从算法原理、代码实现到硬件部署的全流程,为复现这一前沿机器人系统提供了实战指南。 阅读详情

        太弱了,比赛时只出了A的大数据和BC小数据,排到1700+。赛后才把B的小数据过了。

A. Mushroom Monster

        就是贪心模拟。第一种吃法,只有当前时刻比10秒前少才去吃减少的量,否则不吃。第二种吃法,计算每十秒的减少量,以减少量最大的作为平均速率去吃。

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

int m[10010];

int main(){
	freopen("A-large.in","r",stdin);
	freopen("A-large.out","w",stdout);
	int t;
	cin>>t;
	int x=0;
	while(t--){
		x++;
		int n;
		cin>>n;
		for(int i=1;i<=n;i++){
			scanf("%d",&m[i]);
		}
		int y=0;
		int MAX_speed=0;
		for(int i=2;i<=n;i++){
			if(m[i]<m[i-1]){
				y+=m[i-1]-m[i];
				if(m[i-1]-m[i]>MAX_speed){
					MAX_speed=m[i-1]-m[i];
				}
			}
		}
		int z=0;
		
		for(int i=1;i<n;i++){
			if(m[i]<MAX_speed){
				z+=m[i];
			}else{
				z+=MAX_speed;
			}
		}
		printf("Case #%d: %d %d\n",x,y,z);
	}
	return 0;
}


B. Haircut

        建立一个优先队列去模拟,队列大小是理发师人数,每次有人理完发(pop),下一个人接着上(push)。解题关键在减小模拟的量,因为模拟n个人会超时。小数据可以求时间的公倍数,计算出公倍数时间能理的人数,用总人数模它。大数据则需要二分找一个接近理完但是没有理完的时间,从那个时间开始模拟。

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

#define ll long long

int m[1010];

struct node{
	int idx;
	ll tot_time;
	node(int idx,ll tot_time):idx(idx),tot_time(tot_time){
	}
	node(){
	}
	bool operator <(const node& other)const{
		if(tot_time!=other.tot_time){
			return tot_time>other.tot_time;
		}
		return idx>other.idx;
	}
};

int main(){
	freopen("B-large-practice.in","r",stdin);
	freopen("B-large-practice.out","w",stdout);
	int t;
	cin>>t;
	int cas=0;
	while(t--){
		cas++;
		int b,n;
		cin>>b>>n;
		priority_queue<node> que;
		
		ll MAX_time=0;
		ll MIN_time=100000;
		for(int i=1;i<=b;i++){
			scanf("%d",&m[i]);
			if(m[i]>MAX_time)MAX_time=m[i];
			if(m[i]<MIN_time)MIN_time=m[i];
		}
		
		ll l=(n*MIN_time)/b-MAX_time;
		ll r=(n*MAX_time)/b+MAX_time;
		ll aTime=l;
		while(l<=r){
			ll mid=(l+r)>>1;
			ll cnt=0;
			for(int i=1;i<=b;i++){
				cnt+=mid/m[i];
				if(mid%m[i])cnt++;
				if(cnt>=n)break;
			}
			if(cnt>=n){
				r=mid-1;
			}else{
				l=mid+1;
				aTime=mid;
			}
		}
		
		ll cnt=0;
		for(int i=1;i<=b;i++){
			cnt+=aTime/m[i];
			if(aTime%m[i])cnt++;
			que.push( node(i, (m[i]-aTime%m[i])%m[i] ) );
		}
		
		for(int i=cnt+1;i<n;i++){
			node cur=que.top();	que.pop();
			que.push( node( cur.idx,cur.tot_time+m[cur.idx]) );
		}
		node ans=que.top();
		printf("Case #%d: %d\n",cas,ans.idx);
	}
	return 0;
}


C. Logging

        一看到凸包有点蒙了,不过解法貌似不需要凸包。小数据可以枚举每个点i,然后再枚举每个不同于i的点j,连接ij,用叉积计算直线两侧有多少点,取较小的那一侧,对所有j取最小值。这个结果就是为了使i在凸包上需要去掉的点数。大数据不会做。。。

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

#define ll long long

struct Point{
	ll x,y;
	Point(ll x,ll y):x(x),y(y){
	}
	Point(){
	}
}pts[3010];

struct Vector{
	ll x,y;
	Vector(ll x,ll y):x(x),y(y){
	}
	Vector(){
	}
	Vector(Point A,Point B){
		x=B.x-A.x;
		y=B.y-A.y;
	}
};

ll Cross(Vector A,Vector B){
	return A.x*B.y - A.y*B.x;
}

int main(){
	freopen("C-small-attempt2.in","r",stdin);
	freopen("C-small-attempt2.out","w",stdout);
	int t;
	cin>>t;
	int cas=0;
	while(t--){
		cas++;
		int n;
		cin>>n;
		
		for(int i=1;i<=n;i++){
			cin>>pts[i].x>>pts[i].y;
		}
		printf("Case #%d:\n",cas);
		
		for(int i=1;i<=n;i++){
			int ans=max(n-3,0);
			for(int j=1;j<=n;j++){	//枚举 
				if(i==j)continue;
				int left=0;
				int right=0;
				for(int k=1;k<=n;k++){
					if(k==i)continue;
					if(k==j)continue;
					Vector v1 = Vector(pts[i],pts[j]);
					Vector v2 = Vector(pts[i],pts[k]);
					ll cp = Cross(v1,v2);
					if(cp<0)left++;
					if(cp>0)right++;
				}
				int tmp=min(left,right);
				ans=min(ans,tmp);
			}
			cout<<ans<<endl;
		}
	}
	return 0;
}


IEM模型,地表粗糙度模拟 利用微波反演土壤水分时候,利用IEM模型可以实现对随机地表的模拟 立即下载

相关推荐

AI应用架构师干货:智能财务分析AI平台可视化模块设计(附最佳实践)

智能财务分析的价值,从来不是“AI模型有多准”,而是“财务人员能用上AI的结果”。可视化模块的设计,本质是**“站在业务用户的角度,重新定义技术的价值”**——它不需要复杂的动画,不需要华丽的特效,只需要“把AI的结果翻译成财务人员能看懂的语言”。作为AI应用架构师,我们的使命不是“打造最先进的技术”,而是“打造最有用的技术”。而可视化,就是连接技术与业务的那座“桥”。附录:实战项目GitHub仓库(注:此处可放置实际项目的GitHub链接,包含完整代码、数据样例、部署文档)作者简介。

SuperAGI2025 1155

Google Code Jam

    Google从2003年起举办Google Code Jam程序设计竞赛(http://code.google.com/codejam/contest/),用意在提升全球程序开发者交流,同时嘉奖优秀的程序设计者。    粗略的看了一下Code Jam, 与ACM有类似之处, 但是测试的数据是开放的, 并且分为small和big两部分, small主要是用来验证程序的正确性,而big则是

林建华的专栏 3741

机器人抓取(一)—— ROS MoveIt! 程序控制真实UR5机器人运动(python)

接上篇:ubuntu18.04 ros-melodic 安装 ur_robot_driver,驱动真实的 ur5 机器人 上文在 ubuntu 系统中配置了ur 机器人ros功能包 universal_robot 和驱动 Universal_Robots_ROS_Driver,并实现了用 moveit_rviz 拖动机器人运动。本文旨在学习如何使用 moveit python 用户接口moveit_commander,实现真实的ur5 机器人轨迹规划与控制。 1. ur5 机器人控制 参考:MoveIt »

zxxRobot的博客 1万+

Google Code Jam 2015 Round 1A Haircut 二分

题意:给你每个理发师的理发时间,问你排在队列中的第N个位置,问你应该被哪个理发师剪发。 解题思路:二分时间,看这个时间到第几个人理发了,然后找到临界值,看这个值的时候有那些理发师接待了新旅客的,即可找到那个理发师。 解题代码: 1 // File Name: b.sample.cpp 2 // Author: darkdream 3 // Created Time: 201...

weixin_30577801的博客 171

Vue3结合vue-office实现Word文档上传与预览全流程解析

本文详细解析了如何在Vue3项目中集成vue-office插件实现Word文档上传与预览功能。从项目初始化、插件安装到文件上传处理(包括ArrayBuffer转换)、预览优化及常见问题解决方案,提供了一套完整的实现流程,帮助开发者快速实现高效的文档预览功能。

weixin_29001327的博客 464

【超详细】C#的单例模式

本文详细介绍了C#中的单例设计模式,包括两种实现方式:普通类泛型单例(Singleton<T>)和基于MonoBehaviour的组件单例(MonoSingleton<T>)。单例模式通过私有构造、静态私有实例和公共访问入口确保全局唯一实例,具有节省资源、保证数据一致性等优势。文章分别阐述了两者的核心原理、代码实现、使用场景及注意事项,并提供了日志管理器和音效管理器的具体应用示例。特别强调了多线程安全、初始化时机和避免过度使用等重要原则,为Unity开发中合理运用单例模式提供了全面指导。

grapefruit_lyy的博客 1533

codeforces 793D Presents in Bankopolis

题解: 大致题意为给定n最大为80的直线点阵,并给出m条单向路,且这m条路能走的条件是,路经过的点没有被访问过,问走完K个点的最小代价。起点任意,终点任意 由于n很小,第一反应是往费用流想,后来发现无法建图(可能是我太菜了) 之后考虑到是条直线,于是往区间dp的思路去想发现这个转移很好想到 dp[now][l][r][k]表示当前在now这个点,只能在(l,r)中找点,需要访问K-k个点的最小代价...

TelmaZzzz的博客 404

Logstash安装部署

1. 部署及安装所用的用户不能是root。

lmj3732018的博客 4290

Google codejam Qualification Round 2015 B 巧妙枚举结果 + 贪心

背景:想了好久只想到用深搜的指数级别枚举办法来过了小数据,大数据自然超时,后来看了解题报告,才过。 思路:当前所有盘子中,煎饼个数最多的盘子里有n个煎饼,i 从 1 … n 枚举分裂之后的煎饼最多盘子里的个数,然后用贪心的方法计算要达到当前状态所需的最少分裂步数 k ,最后用时就是 i + k ,求出所有用时中最小的即可 感悟:这个题的精华之处是所有最终状态最多只有1000种,对于每种最终状态所

JIBANCANYANG 533

具身智能(40):主流 VLA 模型π₀

摘要: π₀是首款专为机器人设计的VLA(视觉-语言-动作)端到端基础模型,通过双阶段训练实现“感知-决策-执行”闭环。其创新点包括:1)FlowMatching技术实现连续平滑动作控制(精度0.3°);2)结合VLM预训练与多机器人实操数据,零样本任务完成率达76.4%,远超同类模型;3)支持模糊指令理解与动态场景适应(如遮挡识别)。开源版本涵盖不同规模模型,适用于工业装配、服务机器人等场景,在延迟(213ms)和稳定性(92%自主恢复率)上显著领先OpenVLA等竞品。

码农17年的博客 509

《Zephyr OS 入门与实战》第1章:Zephyr OS 架构与物联网定位

【代码】《Zephyr OS 入门与实战》第1章:Zephyr OS 架构与物联网定位。

2301_79143213的博客 1270

codeforces840C On the Bench -- DP

%%%Vectorxj代码#include<cstdio> #include<cstring> #include<iostream> #include<algorithm> using namespace std; #define N 310 #define M 1000000007 int i,j,k,n,m,p,v[N],l,a[N],x,y,t,f[2][N],s; int c[N][N];

gjghfd 656

15、Qt开发中的停靠窗口、工具栏与多文档界面实现

本文详细介绍了Qt开发中停靠窗口、工具栏与多文档界面(MDI)的实现方法。通过QDockWidget和QToolBar构建灵活的用户界面,并利用QMainWindow的saveState和restoreState功能实现布局持久化;使用QMdiArea和QMdiSubWindow实现多文档管理,结合MainWindow与Editor类完成文件操作与窗口控制。文章包含完整代码示例、流程图与表格总结,适用于开发集成环境、文本编辑器等复杂桌面应用。

snow3的博客 163

Google Code Jam Round 1A 2015 解题报告

题目链接:https://code.google.com/codejam/contest/4224486/ Problem A.Mushroom Monster 这题题意就是,有N个时间点,每个时间点,Kaylin可以吃掉一定数量的mushroom,Bartholomew可以放入任意数量的mushroom。 现在给出N个时间点分别有多少mushroom。 问:若Kaylin每个时间...

weixin_30780221的博客 191

深度学习工具包 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")

RU DOS版、EFI版32bit/64bit BIOS常用工具

DOS版、EFI版的RU工具,可用来查看IO、MEM、PCI、SMBIOS等资源。亲测在EFI SHELL下可用。

Google Code jam Qualification Round 2015 解题报告

Problem A. Standing Ovation         题目说的是有许多观众,每个观众有一定的羞涩值,只有现场站起来鼓掌的人数达到该值才会站起来鼓掌,问最少添加多少羞涩值任意的人,才能使所有人都站起来鼓掌。         贪心模拟一下就好,添加的人默认让他们羞涩值为0,扫一遍,让加到刚好够就行。 #include #include #include #includ

A Cube Master 1342

数学建模模型总结

这是本人在两年内准备参加数学建模竞赛搜集到的模型资料,已经经过了本人的筛选和整理,希望能够对准备参加数学建模竞赛的学弟学妹们提供一些帮助!

Google Code Jam Round 1C 2015 Problem A. Brattleship

Problem You're about to play a simplified "battleship" game with your little brother. The board for this game is a rectangular grid withRrows andCcolumns. At the start of the game, you will close...

weixin_30915951的博客 184

老版QQ原生表情gif动态

这是老版的QQ表情,不过全是动态的的,Windows照片查看器是不会动的,可以右击用浏览器打开查看,再说一遍是老版的,只是分享给宁愿用老版也要动态的人。

Google Code Jam 2015 Round1A 题解

快一年没有做题了, 今天跟了一下 GCJ Round 1A的题目, 感觉难度偏简单了, 很快搞定了第一题, 第二题二分稍微考了一下, 还剩下一个多小时, 没仔细想第三题, 以为 前两个题目差不多可以晋级了. 切出去玩了一会, 大概剩半小时, 发现自己的排名逐渐快超 1k了, 果断决定搞出第三题的小数据. 然后简单的O(n^3)的枚举过了. 然后有惊无险的晋级了. 第一题,读懂题目,然后计算就很好...

weixin_30375247的博客 148

Google Code Jam 2015 Round 1A Mushroom Monster 水

题意:每10秒扫描一下盘子,查看盘子里面的面包个数,问你主角用两种吃法可能吃得的最少的面包。 1)任意吃。 2)每秒以恒定速度. 解题思路:暴力,找差值。 解题代码: 1 // File Name: a.cpp 2 // Author: darkdream 3 // Created Time: 2015年04月18日 星期六 09时52分04秒 4 5 #in...

weixin_30807677的博客 250

2015 Google code jam Qualification Round A 水

题意:给你一个序列 从 0-n 初始位置为0 ,只能从 i 走到 i+1 你必要有的人数 >= i+1 ,每个位置有a[i]个人,问你走到 n 还需要多少个人. 解题思路:暴力 解题代码: 1 // File Name: a.cpp 2 // Author: darkdream 3 // Created Time: 2015年04月11日 星期六 23时06分5...

weixin_30270561的博客 114

2015 Google code jam Qualification Round B 枚举 + 贪心

题意:给你一个无穷长的数列 和一些非 0 的值,可以进行两种操作。 1)数列中所有大于1的值 都减1 2)从 a[i] 中取出任意的值分给任意人。 问你最少执行多少步能使的 数列全为0. 解题思路:枚举最大的a[i]。大于 a[i]的部分都分出去。 解题代码: 1 // File Name: b.cpp 2 // Author: darkdream 3 // Crea...

weixin_30594001的博客 92

【No_GG】近在咫尺的绝望 _GCJ Round 1B 2015

Round 1B 2015 - The top-scoring 1000 contestants will advance to Round 2     All Scores   Friends   Closest Competitors

CD's Coding 870

[ Google APAC 2015 University Graduates Test ] Round C APAC Test

题目链接: http://code.google.com/codejam/contest/5214486/dashboard Problem A. Minesweeper 题目意思: 扫雷。告诉地雷所在的位置,求至少须要几步,把全部的非雷位置都翻过来。假设某一个格子周围都不是地雷。则翻转该格子会把周围的格子都翻转过来。 解题思路: dfs找连通块 先把非雷格子周围...

weixin_34281477的博客 136

codeforces 339C 记忆化搜索

C. Xenia and Weights time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Xenia has a set of weights and pan sca

liyunlonghere 883

UVa816 Abbott's Revenge

题意:走迷宫,在某个点,对于mou'g

A Cube Master 1929

树形DP 【codeforces 793D】Presents in Bankopolis

传送门 判断是否是一道树规题: 即判断数据结构是否是一棵树,然后是否符合动态规划的要求。如果是,那么执行以下步骤,如果不是,那么换台。 建树:通过数据量和题目要求,选择合适的树的存储方式。 如果节点数小于5000,那么我们可以用邻接矩阵存储,如果更大可以用邻接表来存储(注意边要开到2*n,因为是双向的。这是血与泪的教训)。如果是二叉树或者是需要多叉转二叉,那么我

twh233的算法blog 458

CodeForces 136 A.Presents(水~)

Descriptionnn个人互相送礼,第ii个人送第pip_i个人礼物,每个人只会送出一份礼收到一份礼,问第ii个人收到的礼物是谁送的Input第一行一整数nn表示人数,之后nn个整数pip_i表示第ii个人送礼物对象(1≤n≤100)(1\le n\le 100)Output输出nn个整数,第ii个数表示送第ii个人礼物的人Sample Input42 3 4 1Sample Output4 1

ZSQ 626
上一篇: bnuoj 34067 Pair
下一篇: Google Code Jam 2015 Round 1A C large
squee_spoon
博客等级 码龄14年 61粉丝 455原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值