【PAT】1008. Elevator
来源:互联网 发布:nginx alias用法 编辑:程序博客网 时间:2024/05/20 23:38
#define LOCAL#include <iostream>#include <cstdio>#include <cstring>#include <algorithm>#include <string>using namespace std;int main(){ #ifdef LOCAL freopen("data.in","r",stdin); freopen("data.out","w",stdout); #endif // LOCAL int n; cin>>n; int ans; ans=n*5; int first=0; for(int i=0;i<n;i++){ int pos; cin>>pos; if(pos>first){ ans+=(pos-first)*6; first=pos; }else{ ans+=(first-pos)*4; first=pos; } } cout<<ans; return 0;}
0 0
- zju-pat 1008.Elevator
- 1008. Elevator (20)-PAT
- 【PAT】1008. Elevator (20)
- (PAT)1008.Elevator
- PAT 1008. Elevator (20)
- PAT-1008. Elevator
- PAT 1008. Elevator (20)
- pat 1008. Elevator
- PAT 1008. Elevator (20)
- PAT 1008. Elevator (20)
- pat 1008. Elevator (20)
- PAT-A 1008. Elevator
- PAT 1008. Elevator
- 【PAT】1008. Elevator
- PAT 1008. Elevator (20)
- PAT 甲级 1008. Elevator
- [PAT-甲级]1008.Elevator
- PAT 1008. Elevator (20)
- 在SSM中使用shiro实现登录验证(附密码加密)
- 23. Merge k Sorted Lists
- 安卓下Glide缓存问题
- 【ZooKeeper】分布式系统服务器上下线自动感知程序开发
- 浅析 UIApplication 生命周期的一些 delegate 方法
- 【PAT】1008. Elevator
- 蓝桥杯 - 算法训练 - 删除数组零元素 - Java
- js树
- 24. Swap Nodes in Pairs
- vue学习 第四节
- 【问题收录】INSTALL_FAILED_NO_MATCHING_ABIS
- 25. Reverse Nodes in k-Group
- 26. Remove Duplicates from Sorted Array
- Mac基于docker的hadoop单机环境搭建