hdu1008简单电梯时间计算
来源:互联网 发布:淘宝云客服多久结工资 编辑:程序博客网 时间:2024/05/16 00:39
#include<iostream>#include<cstdio>using namespace std;int a[10000],N,i,j,sum;int totle_time(int s[]){ int k=0; i=1; j=0; while(i<=N) { while(j<s[i]) { k+=6; j++; } while(j>s[i]) { k+=4; j--; } if(j==s[i]) { k+=5; } i++; } return k;}int main(){ while(scanf("%d",&N)!=EOF,N) { sum=0; for(i=1;i<=N;i++) { scanf("%d",&a[i]); } sum=totle_time(a); printf("%d\n",sum); } return 0;}
0 0
- hdu1008简单电梯时间计算
- hdu1008 Elevator 电梯 简单模拟计算
- 电梯时间计算
- hdu1008-电梯问题
- hdu1008简单枚举
- HDU1008 - Elevator (简单模拟)
- hdu1008
- hdu1008
- hdu1008
- hdu1008
- HDU1008
- HDU1008
- HDU1008
- hdu1008
- hdu1008
- HDU1008
- hdu1008
- HDU1008
- AVPlayer 监听播放时长错误capturing 'self' strongly in this block is likely to lead to a retain cycle 的解决方法
- 虚拟地址与物理地址 -神贴
- BeanUtils.copyProperties(source, target)用法
- java面试题
- aapt的使用
- hdu1008简单电梯时间计算
- bootstrap 3 nav-tab 用法
- UML DESIGNER 教程 好不容易才找到!!!
- 硬件知识【0】:TTL电平和CMOS电平
- [笔记]ubuntu 13.04 配置YouCompleteMe
- A. Counting Sticks
- Poj 3687 Labeling Balls (拓扑排序)
- 解决 Entity manager has not been injected (is the Spring Aspects JAR configured as an AJC/AJDT aspects
- 基于ZooKeeper的分布式Session实现