HDU 1040 As Easy As A+B(排序)
As Easy As A+B
Give you some integers, your task is to sort these number ascending (升序).
You should know how easy the problem is now!
Good luck!
It is guarantied that all integers are in the range of 32-int.
3 2 1 3
9 1 4 7 2 5 8 3 6 9
1 2 3 4 5 6 7 8 9
#include <cstdio>
#include <iostream>
#include <sstream>
#include <string>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <queue>
#include <vector>
#define PI acos(-1.0)
#define ms(a) memset(a,0,sizeof(a))
#define msp memset(mp,0,sizeof(mp))
#define msv memset(vis,0,sizeof(vis))
#define msd memset(dp,0,sizeof(dp))
using namespace std;
//#define LOCAL
int main()
{
#ifdef LOCAL
freopen("in.txt", "r", stdin);
//freopen("out.txt","w",stdout);
#endif // LOCAL
ios::sync_with_stdio(false);
int N;
cin>>N;
while(N--)
{
int n;
cin>>n;
vector<int> v;
v.clear();
for(int i=;i<n;i++)
{
int t;
cin>>t;
v.push_back(t);
}
sort(v.begin(),v.end());
printf("%d",v[]);
for(vector<int>::iterator it=v.begin()+;it!=v.end();it++)
{
printf(" %d",*it);
}
printf("\n");
}
return ;
}
HDU 1040 As Easy As A+B(排序)的更多相关文章
- HDU 1040 As Easy As A+B (排序。。。水题)
题意:给定n个数,让你从小到大排序. 析:不说什么了. 代码如下: #include <cstdio> #include <iostream> #include <cst ...
- hdu 1040 As Easy As A+B(排序)
题意:裸排序 思路:排序 #include<iostream> #include<stdio.h> #include<algorithm> using namesp ...
- 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 probl ...
- 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) T ...
- HDU 1040 As Easy As A+B [补]
今天去老校区找她,不想带电脑了,所以没时间A题了 /*******************************************************************/ As Ea ...
- HDU 5572 An Easy Physics Problem (计算几何+对称点模板)
HDU 5572 An Easy Physics Problem (计算几何) 题目链接http://acm.hdu.edu.cn/showproblem.php?pid=5572 Descripti ...
- 杭电 1040 As Easy As A+B 【排序】
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1040 解题思路:数据不大,可以直接用冒泡排序 #include<stdio.h> int ...
- hdu 5058 So easy
题目连接 http://acm.hdu.edu.cn/showproblem.php?pid=5058 So easy Description Small W gets two files. Ther ...
- hdu 5475 An easy problem(暴力 || 线段树区间单点更新)
http://acm.hdu.edu.cn/showproblem.php?pid=5475 An easy problem Time Limit: 8000/5000 MS (Java/Others ...
随机推荐
- StreamWriter(ms, new UTF8Encoding(false))可以达到不输出BOM的需求。
winform 通过webservice向服务器提交图片需要注意的地方 最近一个winform项目中需要通过拍照或者上传本地文件或者截图的方式把产品图片上传到服务器,最后选择了服务器部署webserv ...
- js正则验证邮箱格式
首先总结一下邮箱的格式,邮箱由@分隔,左侧为用户名,右侧为邮箱域名,用户名可以由字母.数字._.-以及.组成,但是必须是以字母或数字开头,邮箱的域名是由字母.数字.-和.组成的,但是必须以.加上字母的 ...
- mybatis3.4测试CRUD
导入包 H:\jar\jdbc\mysql-connector-java-5.1.13-bin.jarH:\jar\mybatis\mybatis-3.4.1\mybatis-3.4.1.jarH:\ ...
- LigerUI权限系统之菜单管理
菜单管理跟上篇的组织结构实现方式差不多,所以不存在多大的问题.还是老样,先上图,再看代码.菜单管理界面 菜单管理添加: 菜单管理修改: 前端完整代码: @section headerScripts{ ...
- android 源码编译 问题 列表
转自:http://www.cnblogs.com/xilinch/archive/2013/04/02/2996359.html make: *** [out/host/linux-x86/obj/ ...
- wubi安装ubuntu后,增加swap大小,优化swap的使用参数-----------让ubuntu健步如飞,为编译android源码准备
wubi安装ubuntu后,终端输入free -m可以查到如下信息: total used free shared buffers cached Mem: 1944 1801 143 0 557 70 ...
- Oracle笔记(六) 多表查询
最近看了李兴华的oracle视频,这是网上别人做的笔记非常细致,分享给大家,第六篇 原创地址:http://www.cnblogs.com/mchina/archive/2012/09/07/2651 ...
- .Net程序员学用Oracle系列(5):三大数据类型
<.Net程序员学用Oracle系列:导航目录> 本文大纲 1.Oracle 数据类型概述 2.字符类型 2.1.字符集 & NLS 2.2.常见的两种字符串 2.3.NCHAR ...
- C语言之逻辑运算符
一 逻辑运算符: &&:逻辑与,读作并且 表达式左右两边都为真,那么结果才为真 口诀:一假则假 ||:逻辑或,读作或者 表达式左右两边,有一个为真,那么结果就为真 口诀:一真则真 !: ...
- Struts入门(二) 配置文件的讲解
上一章我们演示了Struts项目的搭建 可以看到里面有几个重要的配置文件 下面我们来说明一下这3个配置文件 1.web.xml 2.strtus.xml 3.struts.properties 1 ...