QDU_CEF(补)

【CodeForces 555A】Case of Matryoshkas(模拟) A. Case of Matryoshkas time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Andrewid the Android is a galaxy-f 阅读详情

C - Arthur and Table

 

Arthur has bought a beautiful big table into his new flat. When he came home, Arthur noticed that the new table is unstable.

In total the table Arthur bought has n legs, the length of the i-th leg is li.

Arthur decided to make the table stable and remove some legs. For each of them Arthur determined number di — the amount of energy that he spends to remove the i-th leg.

A table with k legs is assumed to be stable if there are more than half legs of the maximum length. For example, to make a table with 5 legs stable, you need to make sure it has at least three (out of these five) legs of the maximum length. Also, a table with one leg is always stable and a table with two legs is stable if and only if they have the same lengths.

Your task is to help Arthur and count the minimum number of energy units Arthur should spend on making the table stable.

Input

The first line of the input contains integer n (1 ≤ n ≤ 105) — the initial number of legs in the table Arthur bought.

The second line of the input contains a sequence of n integers li (1 ≤ li ≤ 105), where li is equal to the length of the i-th leg of the table.

The third line of the input contains a sequence of n integers di (1 ≤ di ≤ 200), where di is the number of energy units that Arthur spends on removing the i-th leg off the table.

Output

Print a single integer — the minimum number of energy units that Arthur needs to spend in order to make the table stable.

Examples

Input

2
1 5
3 2

Output

2

Input

3
2 4 4
1 1 1

Output

0

Input

6
2 2 1 1 3 3
4 3 5 5 2 1

Output

8

题意:将某些桌子腿砍掉,使得当前长度最大的桌子腿的数量大于总数量的一半

思路:我们可以枚举所有的桌子腿,找出某一个长度是最适合的,使得代价最小,我们可以想到把大于当前枚举桌子腿的数量给去掉,我们假设我们保留了该长度的桌子腿的数量为x,那么小于该长度的的桌子腿数量最多为x-1。我们可以枚举保留的长度,因为代价最大为200,我们记录下每个代价的个数然后去找

代码:

#include<cstdio>
#include<iostream>
#include<cstring>
#include<algorithm>
#include<queue>
#include<stack>
#include<map>
#include<set>
#include<vector>
#include<cmath>
#define MAX 100005

typedef long long ll;
using namespace std;
int a[MAX];

struct node
{
	int len,val;
}p[MAX];
bool cmp(node x,node y)
{
	return x.len<y.len;
}
int sumlen[MAX],sumcost[MAX];
int vis1[MAX],vis2[MAX];
int summ[205];
int main()
{
	int n;
	cin>>n;
	for(int t=1;t<=n;t++)
	{
		scanf("%d",&p[t].len);
		vis1[p[t].len]++;
	}
	for(int t=1;t<=n;t++)
	{
		scanf("%d",&p[t].val);
		sumcost[p[t].len]+=p[t].val;
	}
	sort(p+1,p+n+1,cmp);
	
	int maxn1=p[n].len;
	
	for(int t=1;t<=maxn1;t++)
	{
		sumcost[t]+=sumcost[t-1];
	}
	
	int ans;
	int minn=0x3f3f3f3f;
	for(int t=1;t<=n;t++)
	{
		int left=vis1[p[t].len]-1;
		ans=sumcost[maxn1]-sumcost[p[t].len];
		for(int j=200;j>=1;j--)
		{
			if(vis2[j]>0)
			{
				if(left>=vis2[j])
				{
					left-=vis2[j];
				}
				else
				{
					ans+=j*(vis2[j]-left);
					left=0;
				}
			}
		}
		minn=min(minn,ans);
		vis2[p[t].val]++;
	}
    
	cout<<minn<<endl;
	
	
	return 0;
}

E - Case of Matryoshkas 

Andrewid the Android is a galaxy-famous detective. He is now investigating the case of vandalism at the exhibition of contemporary art.

The main exhibit is a construction of n matryoshka dolls that can be nested one into another. The matryoshka dolls are numbered from 1 to n. A matryoshka with a smaller number can be nested in a matryoshka with a higher number, two matryoshkas can not be directly nested in the same doll, but there may be chain nestings, for example, 1 → 2 → 4 → 5.

In one second, you can perform one of the two following operations:

  • Having a matryoshka a that isn't nested in any other matryoshka and a matryoshka b, such that b doesn't contain any other matryoshka and is not nested in any other matryoshka, you may put a in b;
  • Having a matryoshka a directly contained in matryoshka b, such that b is not nested in any other matryoshka, you may get a out of b.

According to the modern aesthetic norms the matryoshka dolls on display were assembled in a specific configuration, i.e. as several separate chains of nested matryoshkas, but the criminal, following the mysterious plan, took out all the dolls and assembled them into a single large chain (1 → 2 → ... → n). In order to continue the investigation Andrewid needs to know in what minimum time it is possible to perform this action.

Input

The first line contains integers n (1 ≤ n ≤ 105) and k (1 ≤ k ≤ 105) — the number of matryoshkas and matryoshka chains in the initial configuration.

The next k lines contain the descriptions of the chains: the i-th line first contains number mi (1 ≤ mi ≤ n), and then mi numbers ai1, ai2, ..., aimi — the numbers of matryoshkas in the chain (matryoshka ai1 is nested into matryoshka ai2, that is nested into matryoshka ai3, and so on till the matryoshka aimi that isn't nested into any other matryoshka).

It is guaranteed that m1 + m2 + ... + mk = n, the numbers of matryoshkas in all the chains are distinct, in each chain the numbers of matryoshkas follow in the ascending order.

Output

In the single line print the minimum number of seconds needed to assemble one large chain from the initial configuration.

Examples

Input

3 2
2 1 2
1 3

Output

1

Input

7 3
3 1 3 7
2 2 5
2 4 6

Output

10

Note

In the first sample test there are two chains: 1 → 2 and 3. In one second you can nest the first chain into the second one and get 1 → 2 → 3.

In the second sample test you need to disassemble all the three chains into individual matryoshkas in 2 + 1 + 1 = 4 seconds and then assemble one big chain in 6 seconds.

这道题应该是这次最简单的签到题,但是我读错了题意,我以为是接的时候可以接一个链,但是却是只能单哥的接

思路:找出1连续的链不拆,其余都拆,一个记录拆的总时间,一个记录拆出来多少链,这样最后连的时候是总链数-1

代码:

#include<cstdio>
#include<iostream>
#include<cstring>
#include<algorithm>
#include<queue>
#include<stack>
#include<map>
#include<set>
#include<vector>
#include<cmath>
#define MAX 100005

typedef long long ll;
using namespace std;
int a[MAX];

int main()
{
	int n,m;
	cin>>n>>m;
	int s=0;
	int cnt;
	int sum=0;
	for(int t=1;t<=m;t++)
	{
		int x;
		cin>>x;
		cnt=0;
		for(int j=1;j<=x;j++)
		{
			scanf("%d",&a[j]);
		}
		for(int j=2;j<=x;j++)
		{
	           if(a[j]==j)
	           {
	           	 continue;
			   }
			   else
			   {
			   	s++;
			   	cnt++;
			   }
		}
		sum+=cnt+1;
		
	}
	cout<<s+sum-1<<endl; 
	return 0;
}

F - Amr and Chemistry

 

Amr loves Chemistry, and specially doing experiments. He is preparing for a new interesting experiment.

Amr has n different types of chemicals. Each chemical i has an initial volume of ailiters. For this experiment, Amr has to mix all the chemicals together, but all the chemicals volumes must be equal first. So his task is to make all the chemicals volumes equal.

To do this, Amr can do two different kind of operations.

  • Choose some chemical i and double its current volume so the new volume will be 2ai
  • Choose some chemical i and divide its volume by two (integer division) so the new volume will be 

Suppose that each chemical is contained in a vessel of infinite volume. Now Amr wonders what is the minimum number of operations required to make all the chemicals volumes equal?

Input

The first line contains one number n (1 ≤ n ≤ 105), the number of chemicals.

The second line contains n space separated integers ai (1 ≤ ai ≤ 105), representing the initial volume of the i-th chemical in liters.

Output

Output one integer the minimum number of operations required to make all the chemicals volumes equal.

Examples

Input

3
4 8 2

Output

2

Input

3
3 5 6

Output

5

Note

In the first sample test, the optimal solution is to divide the second chemical volume by two, and multiply the third chemical volume by two to make all the volumes equal 4.

In the second sample test, the optimal solution is to divide the first chemical volume by two, and divide the second and the third chemical volumes by two twice to make all the volumes equal 1.

题意比较好理解

题意:对每个数进行*2或/2的操作,使得最后所有的数都是相等的,求最少的操作次数

思路:我们可以枚举可能是从所有的数,分别记录一下把这个数能到达的数及到达需要的次数记录下来,去找的时候

 注意奇偶性,偶数可以×2除2操作,奇数只能乘,最后枚举可以到达的数中次数最小的即可

代码:

#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
#include<queue>
#include<stack>
#include<set>
#include<map>
#include<vector>
#include<cmath>
#define MAX 100005

typedef long long ll;
using namespace std;
int a[MAX];
int sum[MAX];
int num[MAX];
int main()
{
	int n;
	cin>>n;
	memset(sum,0,sizeof(sum));
	memset(num,0,sizeof(num));
	for(int t=1;t<=n;t++)
	{
		scanf("%d",&a[t]);
	}
	int maxn=100000;
	for(int t=1;t<=n;t++)
	{
		    int k = a[t];
            int pre = 0;
            while(k)
			{
                int s = 0;
                while(k% 2 == 0)
				{
                    k/= 2;
                    s++;
                }
                int y = k;
                int x1 = 0;
                while(y <= maxn)
				{
                    num[y]++;
                    sum[y]+=pre+abs(s - x1);
                    x1++;
                    y*=2;
                }
                pre+=s+1;
                k/= 2;
            }
	}
	int minn=0x3f3f3f3f;
   
	for(int t=1;t<=maxn;t++)
	{
		if(num[t]==n)
		minn=min(minn,sum[t]);
	}
	cout<<minn<<endl;
	
	
	
	
	return 0;
}

 

银河麒麟V10 SP1忘记密码?3分钟搞定单用户模式密码重置(附详细截图) 本文详细介绍了银河麒麟V10 SP1操作系统忘记登录密码后的应急恢复方法。核心是通过GRUB引导菜单进入单用户模式,无需密码即可获得root权限,从而快速重置用户密码。文章提供了从捕捉GRUB界面、编辑启动参数到执行密码修改命令的完整步骤图解与常见问题解决方案,帮助用户在几分钟内恢复系统访问。 阅读详情

相关推荐

AI Agent技能评测框架SkillsBench:从黑盒评估到白盒技能拆解

在人工智能领域,模型评估是衡量技术进展的核心环节。传统评测基准如GLUE、MMLU主要关注模型的通用认知能力,但实际工程应用中,AI Agent需要的是在复杂场景中协调多种能力的“职业技能”。SkillsBench创新性地将Agent能力进行原子化拆解,定义了理解规划、工具调用、推理决策、交互安全等技能维度,并通过领域专家构建的评测集确保生态效度。这一框架为Agent开发提供了精准的“度量衡”,使性能优化从经验驱动转向数据驱动,同时为不同模型和框架提供了公平比较的基础,推动了AI Agent生态从“野蛮生长

weixin_30530339的博客 395

Codeforces 557C Arthur and Table【思维】

C. Arthur and Table time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Arthur has bought a beautiful big table into his n

mengxiang000000 1050

【探秘】二维异形件重叠移除算法:从度量到消除的实战解析

本文深入解析二维异形件重叠移除算法的核心技术与实战应用,涵盖重叠度量、零件扰动策略及消除方法。通过NFP(临界多边形)技术、空间分区加速等优化手段,有效解决异形件排版中的重叠问题,提升材料利用率和计算效率。适合制造业、CAD软件开发者及算法工程师参考。

weixin_28698059的博客 266

codeforces 311(div2)C-Arthur and Table

Arthur and Table Arthur has bought a beautiful big table into his new flat. When he came home, Arthur noticed that the new table is unstable. In total the table Arthur bought has n legs, the lengt

lljjccsskk的专栏 551

Vofa+使用笔记(1):用Vofa+通过串口连接显示波形

1. 介绍 Vofa+有三种协议设置 rawdata:你发什么就显示什么,跟普通的串口助手一样 firewater:最简单在VOFA+里绘制波形的协议,建议仅在通道数量不多、发送频率不高的时候使用。 justfloat:有一定的数据格式,此协议非常适合用在通道数量多、发送频率高的时候。 2. 使用步骤 设置号下面三个地方,使用的协议以及传输的方式 拉出控件 (最开始上位机没有识别到你的数据的时候,右边是没有数据显示的,如果你想要y轴显示什么数据,右边设置显示也可以,右键波形图然后Y轴设置也行) 把进

苏释州的博客 5万+

STM32结合FFT与窗函数优化,实现高精度正弦信号提取

本文详细介绍了如何在STM32嵌入式平台上结合FFT算法与窗函数优化技术,实现高精度正弦信号提取。通过分析频谱泄漏原理,对比汉宁窗、汉明窗等窗函数特性,并提供实际代码示例和幅值补偿方法,有效解决了工业检测中信号精度不足的问题。

v5w6x的博客 226

【codeforces 557C Arthur and Table】+ 思维

C. Arthur and Table time limit per test 1 second memory limit per test 256 megabytes input standard input output standard outputArthur has bought a beautiful big table into his new flat. When h

楚江枫 747

Claude Code vs Codex实战对比:哪个更适合你的Next.js项目?(含真实案例)

本文通过两个真实的Next.js项目案例,深度对比了Claude Code与Codex在UI实现和业务逻辑构建中的表现。Claude Code在代码质量、设计还原度和架构完整性方面优势明显,适合对可维护性要求高的生产级项目;而Codex则以快速响应和低成本见长,更适合原型开发或内部工具。文章提供了基于项目类型、团队能力和成本效益的详细选择策略。

weixin_29201859的博客 819

CF 557C(Arthur and Table-直接暴力)

C. Arthur and Table time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Arthur has bought a beautiful big table

nike0good |Oier&ACMer | 熟能生巧 3540

RK3588适配Ubuntu系统

RKsdk上支持buildroot以及Debian系统,但是Ubuntu需要自己移植,有很多公司都移植好了可以直接用,这里就总结记录一下我制作Ubuntu的过程。

m0_60805802的博客 5371

手把手教你学Simulink--基于新型通信技术集成的场景实例:无人机利用激光通信实现高速率数据传输

摘要: 本文基于Simulink搭建无人机激光通信仿真系统,解决传统射频通信带宽不足问题。系统通过五层架构(发射机、信道、PAT系统、接收机、性能分析)实现Gbps级高速传输,重点建模大气衰减(雾/雨)、光束发散、PAT精跟踪(Stateflow+PID控制)等核心模块。仿真结果显示:晴天链路可达2.5Gbps(BER 1e-8),浓雾下链路中断,验证了雾是主要性能限制因素。案例涵盖调制方式选择、动态环境仿真及3D可视化,为无人机高速数据传输提供可扩展的仿真框架,并指出混合FSO/RF、AI-PAT等优化方

MHD0815的博客 189

Codeforces Round #311 (Div. 2) C. Arthur and Table

C. Arthur and Table time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Arthur has bought a beautiful big table into his n

一点也不二 1708

RT-DETR训练自己的数据集(从代码下载到实例测试)

在Windows10上配置CUDA环境教程是百度提出的一种实时目标检测模型。RT-DETR采用了与DETR相同的编码器和解码器结构,但对其进行了大量的优化,在保持较高检测精度的同时,实现了实时目标检测,为目标检测领域提供了一种新的有效解决方案,具有广泛的应用前景,如自动驾驶、智能监控、机器人等领域。以上是RT-DETR官方的论文和代码,详细介绍了RT-DETR的构成和实现。在YOLOv10中也实现了RT-DETR的代码,所以本文使用YOLOv10的项目文件进行RT-DETR的训练和测试。YOLOv10。

Limiiiing的博客 4万+

CodeForces 567C Case of Matryoshkas map+递推

原题: http://codeforces.com/contest/556/problem/C题目:Case of Matryoshkas time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output Andrewid the Androi

ShineRoyal 766

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

STM32F407中文手册

STM32f407中文手册 本参考手册面向应用开发人员,提供有关使用 STM32F405xx/07xx、STM32F415xx/17xx、 STM32F42xxx 和 STM32F43xxx 微控制器存储器与外设的完整信息。STM32F405xx/07xx、STM32F415xx/17xx、STM32F42xxx 和 STM32F43xxx 构成一个微 控制器系列,各产品具有不同的存储器大小、封装和外设。有关订购信息以及器件的机械与电气特性,请参见数据手册。有关 ARM Cortex™-M4F 内核的信息,请参见《Cortex™-M4F 技术参考手册》。

Problem - 557C - Codeforces - Arthur and Table

Arthur and TableArthur has bought a beautiful big table into his new flat. When he came home, Arthur noticed that the new table is unstable.In total the table Arthur bought has n legs, the length of th

xiyue_jiang的博客 444

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

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

Codeforces 557C Arthur and Table 【树状数组 + 二分】

题目链接:Codeforces 557C Arthur and Table C. Arthur and Table time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output Arthur has bought a beautiful b

世界很大 802

ssm框架搭建

这个是一个在idea上成功跑起来的ssm框架项目,保存在这里方便以后使用直接下载

A. Case of Matryoshkas

time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Andrewid the Android is a galaxy-famous detective. He is now inv

无知的我 1472

Codeforces Round #310 (Div. 2) A. Case of the Zeros and Ones 水题

A. Case of the Zeros and Ones Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/556/problem/A Description Andrewid the Android is a galaxy-famous detective. In his fre...

weixin_34032621的博客 226

Arthur and Table 【CodeForces - 557C】【Splay】

题目链接 有一张桌子,有n个腿。第i根腿的长度是li。 现在要拿掉一些腿,使得桌子稳定,拿掉第i根腿需要di的能量。 稳定的条件是,假如拿掉若干条腿之后,桌子还有k个腿,那么长度最长的腿的数目要超过一半。比如桌子有5根腿,那么至少要有三根腿是最长的。另外,只有一根腿的桌子是稳定的,两个腿的桌子想要稳定,必需长度是一样的。 你的任务是拿掉若干腿,使得桌子稳定,并且所消耗的能量要最少。 ...

既然弱小,就只顾变强就是了 278

Towers CodeForces - 229D

The city of D consists ofntowers, built consecutively on a straight line. The height of the tower that goesi-th (from left to right) in the sequence equalshi. The city mayor decided to rebuil...

weixin_30951231的博客 261

codeforces 556B Case of Fake Numbers

Andrewid the Android is a galaxy-famous detective. He is now investigating a case of frauds who make fake copies of the famous Stolp’s gears, puzzles that are as famous as the Rubik’s cube once was.Its

总有那么一群人喜欢盯着我的博客看,估计这是他们见过最长的博客名,我必须得告诉他们博客名最长可以写多长 628

蘑菇街笔试题1

题目一  搬圆桌 现在有一张半径为r的圆桌,其中心位于(x,y),现在他想把圆桌的中心移到(x1,y1)。每次移动一步,都必须在圆桌边缘固定一个点然后将圆桌绕这个点旋转。问最少需要移动几步。 输入描述: 一行五个整数r,x,y,x1,y1(1≤r≤100000,-100000≤x,y,x1,y1≤100000) 输出描述: 输出一个整数,表示答案 输入例子:

走在不归路上 681

Codeforces 556C Case of Matryoshkas【模拟】

A. Case of Matryoshkas time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Andrewid the Android is a galaxy-famous detect

mengxiang000000 595

CodeForces 556A

Description Andrewid the Android is a galaxy-famous detective. In his free time he likes to think about strings containing zeros and ones. Once he thought about a string of length n consisting of

我不坚强谁替我勇敢 852

Codehorses T-shirts (map+遍历)

Codehorses has just hosted the second Codehorses Cup. This year, the same as the previous one, organizers are giving T-shirts for the winners. The valid sizes of T-shirts are either "M" or from 00 to...

black_hole6的博客 1万+
上一篇: Fountains(非线段树版(主要是不太会用))
下一篇: 九宫幻方
black-hole6
博客等级 码龄9年 2万+粉丝 338原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

打赏作者

black-hole6

你的鼓励将是我创作的动力

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

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

打赏作者

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

抵扣说明:

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

余额充值