思路:

模拟。

实现:

 #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. ArcGIS for Android入门程序之DrawTool2.0

    来自:http://blog.csdn.net/arcgis_mobile/article/details/8084763 GISpace博客<ArcGIS for Android入门程序之Dr ...

  2. 玩转iOS开发 - 消息推送

    消息推送

  3. jqury-validate表单验证

    首先需要引入插件:jquery.validate.js这个插件. 然后对需要验证的表单实现js: $("#add-firewalls-form").validate({ submi ...

  4. 获取Linux磁盘分区的UUID

    在设置fstab自动挂载时,需要填写如下的信息: # <file system> <mount point> <type> <options> < ...

  5. lambda和委托那点事

    Lambda 简介 Lambda 表达式是一种可用于创建委托或表达式目录树类型的一种匿名函数(匿名方法+Lambda).通过使用 lambda 表达式,可以写入可作为参数传递或作为函数 调用值返回的本 ...

  6. Python常用数据处理函数

    1.基本统计特征函数 方法名 函数功能 所属库 使用格式 sum() 计算数据样本综合(按列计算) Pandas D.sum() mean() 计算数据样本算数平均数 Pandas D.mean() ...

  7. Cannot change version of project facet Dynamic Web Module to 3.1 (Eclipse Maven唯一解决方式)

    If you want to use version 3.1 you need to use the following schema: http://xmlns.jcp.org/xml/ns/jav ...

  8. Codeforces Round #214 (Div. 2) C. Dima and Salad 背包

    C. Dima and Salad   Dima, Inna and Seryozha have gathered in a room. That's right, someone's got to ...

  9. frame pointer及其用途

    1 什么是frame pointer frame pointer指向本函数栈帧顶,通过它可以找到本函数在进程栈中的位置.有专门的寄存器保存该值. 2 frame pointer有什么用 主要是back ...

  10. ugc pgc ogc web2.0 mgc

    http://yjy.people.com.cn/n/2014/0120/c245079-24169402.html machine