http://www.bnuoj.com/bnuoj/problem_show.php?pid=2490

这个题是先输入一个整数n,说明有几个数据,然后输入n个整数,然后用三个#分开,后面输入整数k,代表有k个数据,后面每个数据代表查询前面那几个整数中从小到大排序后的第几个数。

AC代码:
#include<iostream>
#include<cstdio>
#include<algorithm> using namespace std; bool cmp(int a, int b)
{
return a<b;
} int a[100010]; int main()
{
int n,i,k;
char b[3];
while(scanf("%d",&n)!=EOF)
{
for(i = 0; i < n; i++)
{
scanf("%d",&a[i]);
}
sort(a,a+n,cmp);
scanf("%s",&b);
scanf("%d",&k);
while(k--)
{
scanf("%d",&n);
printf("%d\n",a[n-1]);
}
} return 0;
}

BNU Questions and answers的更多相关文章

  1. 101+ Manual and Automation Software Testing Interview Questions and Answers

    101+ Manual and Automation Software Testing Interview Questions and Answers http://www.softwaretesti ...

  2. Top 25 Most Frequently Asked Interview Core Java Interview Questions And Answers

    We are sharing 25 java interview questions , these questions are frequently asked by the recruiters. ...

  3. [译]Node.js Interview Questions and Answers (2017 Edition)

    原文 Node.js Interview Questions for 2017 什么是error-first callback? 如何避免无止境的callback? 什么是Promises? 用什么工 ...

  4. 115 Java Interview Questions and Answers – The ULTIMATE List--reference

    In this tutorial we will discuss about different types of questions that can be used in a Java inter ...

  5. 69 Spring Interview Questions and Answers – The ULTIMATE List--reference

    This is a summary of some of the most important questions concerning the Spring Framework, that you ...

  6. 300+ Manual Testing and Selenium Interview Questions and Answers

    Manual testing is a logical approach and automation testing complements it. So both are mandatory an ...

  7. 【译】Core Java Questions and Answers【1-33】

    前言 译文链接:http://www.journaldev.com/2366/core-java-interview-questions-and-answers Java 8有哪些重要的特性 Java ...

  8. Oracle Purchasing QUESTIONS AND ANSWERS

    Topic Summary Topic: CORRECTIONS: Corrections Topic: DELIVER: Receiving Delivery Topic: DROPSHIP: Dr ...

  9. Poj 2371 Questions and answers(排序)

    题目链接:http://poj.org/problem?id=2371 思路分析:使用计数排序或其他时间复杂度为O( log N )的排序. 代码如下: #include <iostream&g ...

随机推荐

  1. JavaSE学习总结第11天_开发工具 & API常用对象1

      11.01 常见开发工具介绍 1:操作系统自带的记事本软件 2:高级记事本软件例:Editplus,Notepad++,UltraEdit 3:集成开发环境 IDE(Integrated Deve ...

  2. python学习之lambda匿名函数

    1 Python支持运行时使用“lambda”建立匿名函数(anonymous functions that are not bound to a name). python "lambda ...

  3. Non recursive Depth first search

    深度优先非递归实现算法: 1 递归算法: //初始化相关数据结构 DFS(G) ------------------------------------------------------------ ...

  4. Web Api Route 注册要放在 Mvc Route 注册前

    今天想研究一下Web Api,写了一个测试Api,打开网站后浏览一下,可是却提示找不到方法,刚开始以为哪里配置错了,可找了半天也没见. 因为我是在一个现有Mvc站点做的Demo,所以打算新建一个Mvc ...

  5. Android 网络交互之MD5为什么要加盐

    MD5为什么要加盐 之前面试的时候,遇到一个面试的哥哥.不停的跟我确认我对网络传输过程中的password进行MD5加密的时候,是否加key了. 当时我很纳闷,因为MD5本身已经是不可逆的了,需要破解 ...

  6. Windows Phone 8初学者开发—第1部分:系列介绍

    原文 Windows Phone 8初学者开发—第1部分:系列介绍 您好,欢迎来到这个包含35课为Window Phone 8平台创建应用程序的系列教程.我叫Bob Tabor,在过去的11年中我一直 ...

  7. 转: c++继承中的内存布局

    英文原文: http://www.openrce.org/articles/files/jangrayhood.pdf 翻译: http://blog.csdn.net/jiangyi711/arti ...

  8. VC中TRACE()的用法

    个人总结:最近看网络编程是碰到了TRACE语句,不知道在哪里输出,查了一晚上资料也没找出来,今天终于在CSDN上找到了,真是个高地方啊,方法如下: 1.在MFC中加入TRACE语句 2.在TOOLS- ...

  9. ASP.NET身份验证的几种方式

    1.windows身份验证 2.  Forms验证 3.Passport验证 4.none http://www.jb51.net/article/30510.htm

  10. C# lazy<T>的用法

    .NET 4.0中加入了lazy<T>(懒对象),其实叫懒对象感觉不对,更应该叫延迟对象加载. 正如我们所知,对象的加载是需要消耗时间的,特别是对于大对象来说消耗的时间更多.lazy可以实 ...