hdu1008
来源:互联网 发布:微信js接口安全域名 编辑:程序博客网 时间:2024/06/05 05:40
#include <stdio.h>int main ( ) { int ct; while ( scanf ( "%d", &ct ) != EOF && ct ) { int ar[ct + 2]; for ( int i = 1; i <= ct; ++i ) scanf ( "%d", &ar[i] ); ar[0] = 0; int ans = 0; for ( int i = 1; i <= ct; ++i ) { if ( ar[i] > ar[i - 1] ) ans += ( ar[i] - ar[i - 1] ) * 6; else { ans += ( ar[i - 1] - ar[i] ) * 4; } ans += 5; } printf ( "%d\n", ans ); }}
- hdu1008
- hdu1008
- hdu1008
- hdu1008
- HDU1008
- HDU1008
- HDU1008
- hdu1008
- hdu1008
- HDU1008
- hdu1008
- HDU1008
- HDU1008
- HDU1008
- HDU1008
- HDU1008
- hdu1008
- HDU1008 Elevator
- aop+自定义注解实现操作日志记录
- Win7下安装JDK和配置环境
- hello world!
- C++中const的作用
- PHP 多进程实践(二)
- hdu1008
- epoll原理与应用详解
- Ogre环境的配置
- 数据结构读书笔记(一)(C语言)
- JAVA消息对话框
- JAVA确认对话框
- MirrorLinkNote1.RTP服务端搭建--VLC
- 百练 2854 点和正方形的关系
- 漂亮的WEB桌面+WEB聊天系统