hdu5122 K.Bro Sorting
思路:
模拟。
实现:
#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的更多相关文章
- 树状数组--K.Bro Sorting
题目网址: http://acm.hust.edu.cn/vjudge/contest/view.action?cid=110064#problem/D Description Matt’s frie ...
- HDU 5122 K.Bro Sorting
K.Bro Sorting Time Limit: 2000/2000 MS (Java/Others) Memory Limit: 512000/512000 K (Java/Others) Tot ...
- K.Bro Sorting
Time Limit: 2000/2000 MS (Java/Others) Memory Limit: 512000/512000 K (Java/Others)Total Submissio ...
- 基础题:HDU 5122 K.Bro Sorting
Matt's friend K.Bro is an ACMer.Yesterday, K.Bro learnt an algorithm: Bubble sort. Bubble sort will ...
- K - K.Bro Sorting
Description Matt’s friend K.Bro is an ACMer. Yesterday, K.Bro learnt an algorithm: Bubble sort. Bubb ...
- HDU 5122 K.Bro Sorting(模拟——思维题详解)
题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=5122 Problem Description Matt's friend K.Bro is an A ...
- hdoj 5122 K.Bro Sorting 贪心
K.Bro Sorting Time Limit: 2000/2000 MS (Java/Others) Memory Limit: 512000/512000 K (Java/Others) Tot ...
- K.Bro Sorting(思维题)
K.Bro Sorting Time Limit: 2000/2000 MS (Java/Others) Memory Limit: 512000/512000 K (Java/Others)T ...
- HDU 5122 K.Bro Sorting(2014北京区域赛现场赛K题 模拟)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5122 解题报告:定义一种排序算法,每一轮可以随机找一个数,把这个数与后面的比这个数小的交换,一直往后判 ...
随机推荐
- ArcGIS for Android入门程序之DrawTool2.0
来自:http://blog.csdn.net/arcgis_mobile/article/details/8084763 GISpace博客<ArcGIS for Android入门程序之Dr ...
- 玩转iOS开发 - 消息推送
消息推送
- jqury-validate表单验证
首先需要引入插件:jquery.validate.js这个插件. 然后对需要验证的表单实现js: $("#add-firewalls-form").validate({ submi ...
- 获取Linux磁盘分区的UUID
在设置fstab自动挂载时,需要填写如下的信息: # <file system> <mount point> <type> <options> < ...
- lambda和委托那点事
Lambda 简介 Lambda 表达式是一种可用于创建委托或表达式目录树类型的一种匿名函数(匿名方法+Lambda).通过使用 lambda 表达式,可以写入可作为参数传递或作为函数 调用值返回的本 ...
- Python常用数据处理函数
1.基本统计特征函数 方法名 函数功能 所属库 使用格式 sum() 计算数据样本综合(按列计算) Pandas D.sum() mean() 计算数据样本算数平均数 Pandas D.mean() ...
- 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 ...
- 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 ...
- frame pointer及其用途
1 什么是frame pointer frame pointer指向本函数栈帧顶,通过它可以找到本函数在进程栈中的位置.有专门的寄存器保存该值. 2 frame pointer有什么用 主要是back ...
- ugc pgc ogc web2.0 mgc
http://yjy.people.com.cn/n/2014/0120/c245079-24169402.html machine