HDU 4952Number Transformation(找规律)
来源:互联网 发布:半全局匹配算法 编辑:程序博客网 时间:2024/05/21 10:34
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4952
Number Transformation
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 223 Accepted Submission(s): 98
Problem Description
Teacher Mai has an integer x.
He does the following operations k times. In the i-th operation, x becomes the least integer no less than x, which is the multiple of i.
He wants to know what is the number x now.
He does the following operations k times. In the i-th operation, x becomes the least integer no less than x, which is the multiple of i.
He wants to know what is the number x now.
Input
There are multiple test cases, terminated by a line "0 0".
For each test case, the only one line contains two integers x,k(1<=x<=10^10, 1<=k<=10^10).
For each test case, the only one line contains two integers x,k(1<=x<=10^10, 1<=k<=10^10).
Output
For each test case, output one line "Case #k: x", where k is the case number counting from 1.
Sample Input
2520 102520 200 0
Sample Output
Case #1: 2520Case #2: 2600
AC代码:
#include<stdio.h>__int64 x,k,i,p,t;int main(){t=1;while(~scanf("%I64d%I64d",&x,&k)&&x+k){p=x;for(i=2;i<=k;i++){p=p-p/i;if(p<i)break;}printf("Case #%I64d: %I64d\n",t++,p*k);}return 0;}
0 0
- HDU 4952Number Transformation(找规律)
- HDU 4952 Number Transformation (找规律)
- hdu4952 Number Transformation(数学题 | 找规律)
- HDU 4952 Number Transformation 规律题
- HDU 4952 Number Transformation 打表规律
- HDU 1041 Computer Transformation 【找规律+高精度】
- HDU 4279 Number(找规律)
- HDU 4279 Number(数学题,找规律)
- HDU 4279 Number(找规律)
- hdu 1005 Number Sequence(找规律)
- hdu 4279 Number(找规律)
- HDU 1005-Number Sequence(找规律)
- HDU - 4952 Number Transformation
- HDU 4952 Number Transformation
- hdu 4952 Number Transformation
- hdu 4952 Number Transformation
- hdu 4952Number Transformation
- hdu 4952 Number Transformation
- hdu3397 Sequence operation 线段树区间更新&&bzoj1858: [Scoi2010]序列操作
- 单词记忆汇总
- C程序设计语言(K&R)第七章学习笔记
- 【自考】数据库原理之初识总结
- Jquery鼠标放上去图片放大
- HDU 4952Number Transformation(找规律)
- 收藏js网站
- 程序重构
- esriFeatureType与esriGeometryType的区别与联系
- FZU2107
- UVA - 133 The Dole Queue
- 9i如何确认每个连接用户占用的内存量
- flex--spring--框架---2---正在编写中
- template programming 学习(3) Argument dependent lookup