/*
2011-8-31
author:BearFly1990
*/
package acm.hdu.tests;
import java.io.BufferedInputStream;
import java.util.Arrays;
import java.util.Scanner;
public class HDU_1040 {
public static void main(String[] args) {
Scanner console = new Scanner(new BufferedInputStream(System.in));
Integer[] a = new Integer[1001];
Integer t,n;
t = console.nextInt();
while(t-- > 0){
n = console.nextInt();
for(int i = 0; i < n; i++){
a[i] = console.nextInt();
}
Arrays.sort(a, 0, n);
System.out.print(a[0]);
for(int i = 1; i < n; i++){
System.out.print(" " + a[i]);
}
System.out.println();
}
}
}
相关推荐
第一次面试经历:集创北方数字IC前端面试(崩)总结
时间:2020年8月11日上午10点 公司:集创北方,做LED、LCD、OLED、AMOLED等显示器芯片的公司,应该主要是做显示驱动、图像处理、电源管理等这一块。 岗位:数字IC前端设计 城市:北京 形式:线上面试。感觉我俩是两个社畜,他说摄像头开不开都可以,我说那语音OK吗他说OK,于是直接语音问答。 项目经历:基于FPGA的车牌识别 & 先导存储器集成工艺开发(课题组) & 基于FPGA的贪吃蛇小游戏 反正是凉凉的,这时候准备还不足,前面都在复习项目没怎么刷过题。 过程如下: 自我介绍
As Easy As A+B
Problem Description These days, I am thinking about a question, how can I get a problem as easy as A+B? It is fairly difficulty to do such a thing. Of course, I got it after many waking nights. Give ...
别再乱选保护板了!手把手教你用ABLIC S-8254A为3/4串锂电池组DIY安全保护电路
本文详细介绍了如何使用ABLIC S-8254A保护集成电路为3/4串锂电池组DIY安全保护电路。从选型策略、电路搭建到功能验证,手把手教你实现可靠的充放电保护系统,适用于无人机、电动工具等场景,确保锂电池组的安全使用。
杭电HDOJ 1040 解题报告
As Easy As A+B Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 27708 Accepted Submission(s): 11774 Problem Description These day
TCP/IP工业通信C#极致实现:工业级TcpClient封装 + 粘包拆包彻底解决 + 高频采集专项优化(完整可投产)
在工业自动化、PLC通信、工业传感器/模块、产线高频数据采集等场景中,TCP/IP是绝对主流的通信方式,相比串口/485,具备传输速率高、距离无限制、布线简单、抗干扰强的优势。但工业TCP通信和普通桌面TCP通信有本质区别,工业场景的核心要求是:✔高可靠:7×24小时不间断运行,断网自动重连、异常自动恢复,绝不崩溃;✔无数据错误:彻底解决「粘包、拆包、半包」问题(工业通信第一大坑,90%的通信异常源于此);✔高频采集优化:支持级别的高频读写PLC/设备,无卡顿、无丢帧、CPU占用极低;✔。
YOLOv12改进策略【卷积层】| CVPR-2020 利用DynamicConv 动态卷积 结合A2C2f进行二次创新,提高精度
在大规模视觉预训练中,通常模型的性能受到数据、参数和FLOP三个关键因素的影响。一般来说,模型的参数数量越多,FLOP也越高,但在移动设备等对计算资源有限制的场景下,需要低FLOP的模型同时又希望模型能从大规模预训练中受益。传统的方法很难在增加参数的同时保持低FLOP,因此需要一种新的设计来解决这个问题,模块应运而生。
杭电ACM 1040 As Easy As A+B java 解读
As Easy As A+B Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 48014 Accepted Submission(s): 20587 Problem Description These day
BUG调试案例六:RK3568+国产YT8531网络PING调试案例
这次调试过程让我对后续类似问题的应对更加有信心。如果芯片在其他项目中已被验证可用,那么在我们的设计中原则上也应该能够正常工作。如果出现异常,就必须坚持追根溯源,找出具体原因和根本问题。每一次问题的解决,都是一次深入理解系统和提升能力的机会 —— 在不断探索和学习中,也在持续成长。
ACM-简单题之As Easy As A+B——hdu1040
ACM 简单题 As Easy As A+B hdu1040
C#客户端对接工厂MES的方法
本文介绍了使用C#实现WebApi客户端与工厂MES系统交互的方法。主要包括四个步骤:1)配置工控机IP地址;2)获取服务器URL;3)创建HttpHelper帮助类实现单例模式HttpClient,提供异步POST请求方法;4)通过实例化帮助类实现设备状态数据的JSON格式发送与接收。该方案采用异步通信方式,支持超时处理,能够满足大多数MES系统交互需求,帮助工程师快速完成设备与MES系统的数据对接。文中给出了核心代码片段和完整的数据交互流程示例。
【N32L40X】学习笔记12-规则组+注入组+外部触发启动
使用定时器触发规则通道开始采集数据,采集完成后使用dma传输数据,并启动注入通道转换数据,注入通道转换完成后产生中断,中断中读物注入通道数据。
杭电1124java_杭电ACM 1040 As Easy As A+B java
# As Easy As A+BTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 48014Accepted Submission(s): 20587Problem DescriptionThese days, I am thinki...
【软考中级网络工程师】知识点之 ICMP 协议
本文聚焦软考中级网络工程师必备的 ICMP 协议知识,先概述其在 TCP/IP 协议族网络层的地位与无连接特性,再阐述差错报告、网络诊断等功能。解析报文格式,详解差错与查询类报文类型及工作机制,还介绍其在 Ping、Traceroute 命令中的应用,分析常见攻击与防范措施,最后总结核心要点,为网络工程师学习和应用 ICMP 协议提供全面指导。
HDU 1040 As Easy As A+B 水题
As Easy As A+B Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 58496 Accepted Submission(s): 25030 Problem Description These day
全球国家地区城市数据
MySQL全球国家地区城市数据报。。。。。。。。。。。。
数学建模模型总结
这是本人在两年内准备参加数学建模竞赛搜集到的模型资料,已经经过了本人的筛选和整理,希望能够对准备参加数学建模竞赛的学弟学妹们提供一些帮助!
As Easy As A+B hdu 1040 水题
#include<stdio.h> #include<string.h> #include<stdlib.h> int cmp(const void *a,const void *b) { return *(int * )a-*(int * )b; } int main( ) { int N,T; int i,A[1...
深度学习工具包 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');```[](https://bitdeli.com/free "Bitdeli Badge")
hdu1040 As Easy As A+B sort水题
As Easy As A+BTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 70741 Accepted Submission(s): 30103Problem DescriptionThese days, I am thinking...
jre9下载 jdk9
(Java SE Runtime Environment 9.0) 9.0u175 官方最新版 【x86|x64】
hdu 1040 As Easy As A+B (水题)
As Easy As A+B Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 37343 Accepted Submission(s): 16224 Problem Description These day
HDU-1040-As Easy As A+B(诚如题目所说和A+B一样简单-插入排序水过)
As Easy As A+B Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 45268 Accepted Submission(s): 19340 Problem Description These day
hdu 1040 As Easy As A+B (水题,排序)
小记:练习排序算法可以哦。 思路:选择,冒泡,希尔,
HDU 1040 As Easy As A+B(水~)
Description 给一个序列,将其升序输出 Input 第一行为用例组数T,每组用例占一行,首先输入序列长度n,之后输入n个整数表该序列 Output 对于每组用例,升序输出序列 Sample Input 2 3 2 1 3 9 1 4 7 2 5 8 3 6 9 Sample Output 1 2 3 1 2 3 4 5 6 7 8 9 Solution 排序裸
HDU 1040 As Easy As A+B(深感hdu水题太多。。。)
As Easy As A+B Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 52532 Accepted Submission(s): 22585 Problem Description These days,
HDU 1040.As Easy As A+B【排序】【如题(水!水!水!)】【8月24】
As Easy As A+B Problem Description These days, I am thinking about a question, how can I get a problem as easy as A+B? It is fairly difficulty to do such a thing. Of course, I got it after man
hdu 1040 As Easy As A+B(堆排练习水题~)
堆排写得没有快排顺利 = = 。。。等隔一段时间再写试试#include #include #include #include using namespace std; int n; void HeapMin(int a[],int i,int heapsize) { int larg; int l = i*2, r = i*2+1; if( l
HDU1038——Biker‘s Trip Odometer,HDU1039——Easier Done Than Said?,HDU1040——As Easy As A+B
目录HDU1038——Biker's Trip Odometer题目描述运行代码代码思路HDU1039——Easier Done Than Said?题目描述运行代码代码思路HDU1040——As Easy As A+B题目描述运行代码(冒泡排序)代码思路运行代码(快速排序)代码思路Problem - 1038 代码思路 初始化:无限循环:计算行驶距离:计算平均速度:输出结果:输出格式化的字符串,显示旅行编号、行驶距离和平均速度。使用 和 控制输出的格式,确保小数点后两位的精度。更新计数器:每
HDU-1040 As Easy As A+B
See the article on As Easy As A+B Problem Description These days, I am thinking about a question, how can I get a problem as easy as A+B? It is fairly difficulty to do such a thing. Of course, I got i...
hdu 1040 As Easy As A+B
hdu 1040 As Easy As A+B 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1040 排序水 题目大意:数列排序 题目分析:一个sort()全解决。 以下是代码: #include #include using namespace std; int main() { int t,n,a[10
6688




被折叠的 条评论
为什么被折叠?



