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 解题报告:定义一种排序算法,每一轮可以随机找一个数,把这个数与后面的比这个数小的交换,一直往后判 ...
随机推荐
- JSP的体系结构
以下内容引用自http://wiki.jikexueyuan.com/project/jsp/architecture.html: Web服务器需要一个JSP引擎,即处理JSP页面的容器.JSP容器负 ...
- dstat用法;利用awk求dstat所有列每列的和;linux系统监控
安装:yum install -y dstat dstat命令是一个用来替换vmstat.iostat.netstat.nfsstat和ifstat这些命令的工具,是一个全能系统信息统计工具.与sys ...
- ThinkPHP3.2 点击看不清刷新验证码
欢迎使用Markdown编辑器写博客 baidu了一下.发现没有可用的源码,自己想了想,以下的方法可行. <!DOCTYPE html> <html> <head> ...
- 同一台机子 打开两个tomcat
由于项目測试须要.须要在机子上单独搭建一个图片server,所以就要同一时候打开两个tomcat,这里记录方法. 1. 首先复制一个新的tomcat程序: 2.在新的tomcat程序中改动server ...
- [计算机故障处理]EXCEL文件双击不能直接打开
同事的电脑里的EXCEL文件不知什么原因双击不能直接打开了,双击只能打开软件而且是没有任何表格的,但通过软件中的“打开”再找到指定的文件能打开. 解决方案: 打开excel,依次选择:工具-选项-常规 ...
- 【bzoj4034】[HAOI2015]T2
siz[v]表示以v为根的子树的节点数 top[v]表示v所在的重链的顶端节点 fa[v]表示v的父亲 pos[v]表示v的父边标号 mx[v]表示v的子树中边的标号最大的那条边 参考:http:// ...
- 满足qps 同时兼顾 数据生产速率
满足qps 同时兼顾 数据生产速率
- node.js 在函数内获取当前函数
js 如何在函数体内部知道 自己在哪个函数内运行呢? 打比方: function a() { // 我想在这里知道我的函数名a和函数function a () {...} } 使用Error的调用栈可 ...
- Proxy authentication confirmation prompt keeps popping up although the user/password is saved 火狐浏览器一直提示输入代理的账号和密码
https://support.mozilla.org/zh-CN/questions/943488 signon.autologin.proxy;true network.proxy.share_p ...
- SemaphoreSlim
https://msdn.microsoft.com/en-us/library/system.threading.semaphoreslim(v=vs.110).aspx Represents a ...