URAL 1876 Centipede's Morning 水题
来源:互联网 发布:泰拳教学软件 编辑:程序博客网 时间:2024/06/04 18:12
一只蜈蚣(是这么翻译的吧?)有40只左脚,40只右脚,它有a只左鞋(a>=40),b只右鞋(b>=40),它每次起床穿鞋都会先穿左脚,它从床下拿出一只鞋,如果这只鞋是左脚,那么穿上它一共需要花2s,如果是右脚,那么穿到光着的右脚上需要2s,如果右脚满了,丢到房间的角落也需要花2s。
问它可能花去的最大时间
//author: CHC//First Edit Time:2014-07-18 13:11//Last Edit Time:2014-07-18 13:11#include <iostream>#include <cstdio>#include <cstring>#include <cmath>#include <set>#include <vector>#include <map>#include <queue>#include <set>#include <algorithm>using namespace std;int a,b;int main(){ while(~scanf("%d%d",&a,&b)){ //int ma=40+(a-40)*2+2*b; //int mb=40+(a-40)*2+40+(b-40)*2; int ma=39+39*2+1+(a-40)*2+1; int mb=39+b*2+1; printf("%d\n",max(ma,mb)); } return 0;}
0 0
- URAL 1876 Centipede's Morning 水题
- URAL 1876 Centipede's Morning
- URAL 1876 Centipede's Morning[数论]
- URAL 1876. Centipede's Morning (贪心)
- Ural1876-Centipede's Morning
- SGU 242. Student's Morning
- UPC:2541 HaHa's Morning
- sgu-242 Student's Morning
- URAL 1878Rubinchik's Cube 水题
- morning
- morning
- 解题报告 之 SGU242 Student's Morning
- sgu242:Student's Morning(网络流)
- CENTIPEDE BOT
- Ivan's Car URAL
- URAL 1880Psych Up's Eigenvalues multiset水题
- Ural 1671. Anansi's Cobweb
- Ural 1723. Sandro's Book
- QT工程中使用图片的三种方法
- 阿里云服务器的数据盘挂载操作
- hdu 1166线段树
- live555—VS2010 下live555编译、使用及测试
- 延迟复位模块
- URAL 1876 Centipede's Morning 水题
- eclipse整合git
- error C2440: “初始化”: 无法从“StructOne *(*)[10]”转换为“StructOne *[9][10]”
- (二)Seafile FUSE 虚拟文件系统开发---数据模型
- UIUtils ——一个工具类
- JAVA Annotation
- 基于ArcGIS Flex API实现动态标绘(1.1)
- Linux命令进阶
- HDU 1568 Fibonacci