思路:

模拟。

实现:

 #include <iostream>
#include <cstdio>
using namespace std; int a[], n, t; int main()
{
int temp;
int j = ;
cin >> t;
while (t--)
{
scanf("%d", &n);
int cnt = ;
for (int i = ; i < n; i++)
{
scanf("%d", &a[i]);
}
int minn = n + ;
for (int i = n - ; i >= ; i--)
{
if (a[i] < minn)
minn = a[i];
else
cnt++;
}
printf("Case #%d: %d\n", ++j, cnt);
}
return ;
}

hdu5122 K.Bro Sorting的更多相关文章

  1. 树状数组--K.Bro Sorting

    题目网址: http://acm.hust.edu.cn/vjudge/contest/view.action?cid=110064#problem/D Description Matt’s frie ...

  2. HDU 5122 K.Bro Sorting

    K.Bro Sorting Time Limit: 2000/2000 MS (Java/Others) Memory Limit: 512000/512000 K (Java/Others) Tot ...

  3. K.Bro Sorting

    Time Limit: 2000/2000 MS (Java/Others)    Memory Limit: 512000/512000 K (Java/Others)Total Submissio ...

  4. 基础题:HDU 5122 K.Bro Sorting

    Matt's friend K.Bro is an ACMer.Yesterday, K.Bro learnt an algorithm: Bubble sort. Bubble sort will ...

  5. K - K.Bro Sorting

    Description Matt’s friend K.Bro is an ACMer. Yesterday, K.Bro learnt an algorithm: Bubble sort. Bubb ...

  6. HDU 5122 K.Bro Sorting(模拟——思维题详解)

    题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=5122 Problem Description Matt's friend K.Bro is an A ...

  7. hdoj 5122 K.Bro Sorting 贪心

    K.Bro Sorting Time Limit: 2000/2000 MS (Java/Others) Memory Limit: 512000/512000 K (Java/Others) Tot ...

  8. K.Bro Sorting(思维题)

    K.Bro Sorting Time Limit: 2000/2000 MS (Java/Others)    Memory Limit: 512000/512000 K (Java/Others)T ...

  9. HDU 5122 K.Bro Sorting(2014北京区域赛现场赛K题 模拟)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5122 解题报告:定义一种排序算法,每一轮可以随机找一个数,把这个数与后面的比这个数小的交换,一直往后判 ...

随机推荐

  1. SpringBoot常用注解总结

    在SpringBoot框架中,注解做为一种隐式配置,极大的简化了之前xml文件的配置方式.SpringBoot中包含许多种类的注解,这里对在SpingBoot项目中经常使用到的一些注解的进行大致的归纳 ...

  2. Ubuntu 16.04安装SoapUI工具进行接口测试(Web Service/WSDL/RESTfull)

    SoapUI是一个跨平台接口测试工具,官方提供开源版本和商业版本.可以用来测试WSDL/RESTfull等接口. 替代的工具有JMeter. 一般用于WSDL的接口测试比较多,基于XML的形式,且这类 ...

  3. 【nginx】nginx与apache的优缺点比较

    参考: http://zyan.cc/nginx_php_v6/ nginx相对于apache的优点: 1.轻量级,同样的web 服务,比apache服务器占用更少的内存及资源 2.抗并发,nginx ...

  4. POJ 1849 Two(遍历树)

    POJ 1849 Two(遍历树) http://poj.org/problem?id=1849 题意: 有一颗n个结点的带权的无向树, 在s结点放两个机器人, 这两个机器人会把树的每条边都走一遍, ...

  5. [React] Make Compound React Components Flexible

    Our current compound component implementation is great, but it's limited in that users cannot render ...

  6. echars入门篇

    官网地址:echars. 官方实例:首次使用请点击. 官方文档以及第一次操作实例如下 我们生活中有很多统计图,举例一下,有:柱形图.饼图.折线图等一些可以统计数据的形式. 图有:X轴(横轴),Y轴(纵 ...

  7. Android如何进行单元测试

    Menifest.xml中加入: <application>中加入: <uses-library android:name="android.test.runner&quo ...

  8. Mac SavePanel 保存文件的GUI代码

    // Move the recorded temporary file to a user-specified location (视频文件另存储过程,依据用户选择的路径和文件保存名) NSSaveP ...

  9. java poi excel导入模板设置下拉框

    import org.apache.poi.hssf.usermodel.DVConstraint; import org.apache.poi.hssf.usermodel.HSSFCell; im ...

  10. 【Codevs 2630】宝库通道

    http://codevs.cn/problem/2630/ Solution 预处理f[i][j],代表第j列前i行的代价 枚举上下界,然后做最大子段和,g[i]代表选到第i列的代价, g[k]=( ...