HDU 1040 As Easy As A+B [补]
今天去老校区找她,不想带电脑了,所以没时间A题了
/*******************************************************************/
As Easy As A+B
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 45926 Accepted Submission(s): 19620
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 you some integers, your task is to sort these number ascending (升序).
You should know how easy the problem is now!
Good luck!
contains multiple test cases. The first line of the input is a single
integer T which is the number of test cases. T test cases follow. Each
test case contains an integer N (1<=N<=1000 the number of integers
to be sorted) and then N integers follow in the same line.
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<math.h>
#include<stdio.h>
#include<string.h>
#include<iostream>
#include<algorithm>
using namespace std;
#define N 111555 int a[N],n; int main()
{
int t;cin>>t;
while(t--)
{
cin>>n;
for(int i=;i<n;i++)cin>>a[i];
sort(a,a+n);
int i;
for(i=;i<n-;i++)
printf("%d ",a[i]);
printf("%d\n",a[i]); } return ; } //freopen("1.txt", "r", stdin);
//freopen("2.txt", "w", stdout);
//**************************************
HDU 1040 As Easy As A+B [补]的更多相关文章
- 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(排序)
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【排序】【如题(水!水!水!)】【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 (排序。。。水题)
题意:给定n个数,让你从小到大排序. 析:不说什么了. 代码如下: #include <cstdio> #include <iostream> #include <cst ...
- hdu 1040 As Easy As A+B(排序)
题意:裸排序 思路:排序 #include<iostream> #include<stdio.h> #include<algorithm> using namesp ...
- HDU 5572 An Easy Physics Problem (计算几何+对称点模板)
HDU 5572 An Easy Physics Problem (计算几何) 题目链接http://acm.hdu.edu.cn/showproblem.php?pid=5572 Descripti ...
- 2018 HDU多校第四场赛后补题
2018 HDU多校第四场赛后补题 自己学校出的毒瘤场..吃枣药丸 hdu中的题号是6332 - 6343. K. Expression in Memories 题意: 判断一个简化版的算术表达式是否 ...
- 2018 HDU多校第三场赛后补题
2018 HDU多校第三场赛后补题 从易到难来写吧,其中题意有些直接摘了Claris的,数据范围是就不标了. 如果需要可以去hdu题库里找.题号是6319 - 6331. L. Visual Cube ...
- hdu 5058 So easy
题目连接 http://acm.hdu.edu.cn/showproblem.php?pid=5058 So easy Description Small W gets two files. Ther ...
随机推荐
- 18,OS模块
import os print(os.getcwd())#执行所在的目录 # os.makedirs('\python作业\景s12\day18')#可生成多层递归目录 # os.mkdir('\py ...
- A. Nearest Common Ancestors
A. Nearest Common Ancestors Time Limit: 1000ms Case Time Limit: 1000ms Memory Limit: 10000KB 64-bi ...
- HDU-4847 Wow! Such Doge!,模拟!
Wow! Such Doge! 题意:给定的字符串中doge出现了多少次,直接模拟即可,不用KMP. char s[N]; int main() { // int n; int ans=0; whil ...
- HDU-1030 Delta-wave ,暴力贪心!
Delta-wave 题意:用图中所示的数字填满这个三角形,求n到m的最短路径,也就是最少通过几条边. 思路:简单贪心就可以了,本人是先将每一层的左右端点用结构体存起来,然后分奇偶判断. 这题必须理清 ...
- Terracotta服务器的不同配置方式
Terracotta服务器的不同配置方式 博客分类: 企业应用面临的问题 Java&Socket 开源组件的应用 Terracotta双机多机镜像服务器阵列分片模式企业应用 Terracott ...
- BZOJ 2194 快速傅立叶之二 ——FFT
[题目分析] 咦,这不是卷积裸题. 敲敲敲,结果样例也没过. 看看看,卧槽i和k怎么反了. 艹艹艹,把B数组取个反. 靠靠靠,怎么全是零. 算算算,最终的取值范围算错了. 交交交,总算是A掉了. [代 ...
- [BZOJ1589] [Usaco2008 Dec]Trick or Treat on the Farm 采集糖果(tarjan缩点 + 记忆化搜索)
传送门 先用tarjan缩点,再记忆话搜索一下 #include <stack> #include <cstdio> #include <cstring> #inc ...
- linux 中 stat 函数的用途和使用方法
stat 函数讲解 表头文件: #include <sys/stat.h> #include <unistd.h> 定义函数: int stat(const cha ...
- Find that single one.(linear runtime complexity0
public class Solution { public int singleNumber(int[] nums) { int temp = 0; for (int i=0;i<nums.l ...
- HDU 3001 三进制 状压dp
Travelling Time Limit: 6000/3000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total ...