hdoj1008简单题
2013-02-22 00:25
190 查看
#include<iostream> using namespace std; int main(){ int m; int n; int pre; int total; for(cin>>m; m != 0; cin>>m){ cin>>n; pre = n; total = n * 6; total = total + 5; for(int i = 1; i < m; i++){ cin>>n; if(n > pre){ total = total + 6 * (n - pre); pre = n; }else if(n < pre){ total = total + 4 * (pre - n); pre = n; } total = total + 5; } cout<<total<<endl; } }
相关文章推荐
- HDOJ 1008
- hdoj1008 Elevator(简单运用队列)
- HDOJ 1008模拟水题
- HDOJ1008
- HDOJ1008elevator
- hdoj1008
- hdoj1008(模拟题)
- hdoj 1008 elevator
- hdoj 1008 难度*
- hdoj-1008-Elevator(解题报告)
- hdoj1076简单题
- HDOJ 1008 Elevator
- HDOJ--1008
- Elevator(hdoj 1008)
- hdoj1017简单题
- HDOJ 1008
- HDOJ 1008 Elevator解题报告
- HDOJ1008 Elevator
- HDOJ 1008 Elevator
- hdoj1013简单题