Codeforces Round #103 (Div. 2) A题
来源:互联网 发布:夏老师c语言百度云 编辑:程序博客网 时间:2024/05/17 22:01
这道题目意思很清楚,我在这就不解释了,我一开始也不知道做,看了别人的代码也没有弄懂,后来动手做做发现对了,先让最小的走,然后在让最大的走,不过也要分情况:
#include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;
int a[105];
int main()
{
int n,i,j,high,low,sum,p,q;
scanf("%d",&n);
high=0;low=105;
for(i=1; i<=n; i++)
{
scanf("%d",&a[i]);
if(a[i]>high)
{
high=a[i];
p=i;
}
if(a[i]<=low)
{
low=a[i];
q=i;
}
}
if(p<q)
{
sum=p-1+n-q;
}
else
{
sum=p-1+n-q-1;
}
printf("%d\n",sum);
return 0;
}
- Codeforces Round #103 (Div. 2) A题
- Codeforces Round #181 (Div. 2) A题
- Codeforces Round #184 (Div. 2) A题
- Codeforces Round #172 (Div. 2) A题
- Codeforces Round #166 (Div. 2) A题
- Codeforces Round #132 (Div. 2) A题
- Codeforces Round #131 (Div. 2) A题
- Codeforces Round #133 (Div. 2) A题
- Codeforces Round #137 (Div. 2) A题
- Codeforces Round #138 (Div. 2) A题
- Codeforces Round #147 (Div. 2) A题
- Codeforces Round #141 (Div. 2) A题
- Codeforces Round #143 (Div. 2) A题
- Codeforces Round #135 (Div. 2) A题
- Codeforces Round #163 (Div. 2) A题
- Codeforces Round #146 (Div. 2) A题
- Codeforces Round #111 (Div. 2) A题
- Codeforces Round #101 (Div. 2) A题
- 【mfxp.com_笔者支招:两个小办法抓出隐身好友】
- vs2008编译程序"由于应用程序的配置不正确,应用程序未能启动,重新安装应用程序可能会纠正这个问题"
- 软件工程基础<一>
- c# action<> func<>
- 在csdn中复制的代码 去掉前面的行号
- Codeforces Round #103 (Div. 2) A题
- 如何阅读英文报纸的7个要点
- Java处理OA中常用的word文档,PDf,excel等问题---2
- 马云:给创业者的15个忠告!
- VB数据库经典实例总结(二)
- Android 百度地图v2.1.1在地图上绘制文字方法介绍
- There is no Action mapped for namespace /admin and action name 的一种可能错误
- 【mfxp.com】也许你不知的wifi共享精灵设置方法
- 数字证书, 数字签名, SSL(TLS) , SASL .