HDU 5417-Victor and Machine(水题)
来源:互联网 发布:蒙泰设置打印端口 编辑:程序博客网 时间:2024/05/22 15:47
题目地址:HDU 5417
题意:Victor有一个机器,这个机器每次开启的瞬间会弹出一个小球,之后每隔ww秒会弹出一个小球。因为机器不是很完善,该机器每开启xx秒就得关闭yy秒进行调整,在机器关闭的瞬间可能会有小球弹出,关闭之后一直到下一次开启之前都不会有小球弹出。00时刻,机器第一次开启,Victor想要知道第nn个小球弹出的时刻,你能够告诉他吗?
#include <stdio.h>#include <math.h>#include <string.h>#include <stdlib.h>#include <iostream>#include <sstream>#include <algorithm>#include <set>#include <queue>#include <stack>#include <map>#include <bitset>//#pragma comment(linker, "/STACK:102400000,102400000")using namespace std;typedef long long LL;const int inf=0x3f3f3f3f;const double pi= acos(-1.0);const double esp=1e-7;int main(){ int x,y,w,n; while(~scanf("%d %d %d %d",&x,&y,&w,&n)){ if(n==1) printf("0\n"); else{ int cnt=1; int t1=0,t2=0; int time=0; int s=0; while(cnt<n){ s+=w; if(s<=x){ time+=w; } else{ time=(t1+1)*x+(t2+1)*y; t1++; t2++; s=0; } cnt++; } printf("%d\n",time); } } return 0;}
1 0
- HDU 5417-Victor and Machine(水题)
- hdu 5417 Victor and Machine
- hdu 5417 Victor and Machine
- HDU 5417 Victor and Machine
- HDU-5417Victor and Machine
- hdu 5417 Victor and Machine
- hdu 5417 Victor and Machine
- hdu 5417 Victor and Machine
- hdu 5417 Victor and Machine 思考题
- hdu 5417 Victor and Machine(简单数学题)
- hdu 5417 Victor and Machine(模拟)
- hdu 5417 Victor and Machine 模拟
- hdu 5417 Victor and Machine(水)
- HDOJ 5417 Victor and Machine
- HDU 5417 Victor and Machine(模拟||递推)
- HDOJ 5417 Victor and Machine 水
- HDOJ 5417 Victor and Machine(模拟)
- Victor and Machine
- 2016阿里巴巴校园招聘测试开发工程师笔试附加题(含部分答案)
- 258 Add Digits
- java对文件新建,删除,复制,剪切,重命名
- JAVA2游戏编程——Button(1)
- Spring下载地址
- HDU 5417-Victor and Machine(水题)
- 谈IO与fork结合
- 统计文件中单词频率的各种算法实现
- 二叉树中的数学性质
- mac 下更新 .bash_profile 文件
- ajax--检验用户是否存在
- 模糊识别的聚类分析+C代码
- 使用引导扇区维护工具BOOTICE编辑系统启动列表BCD文件
- win7 下jdk+tomcat配置