Sicily10330
来源:互联网 发布:哪个挂号软件好用抢号 编辑:程序博客网 时间:2024/04/30 08:56
#include <iostream>#include <cstdio>#include <algorithm>#include <cstring>#include <list>using namespace std;int main(){int n,m;scanf("%d%d",&n,&m);if (n%m==0) printf("0\n"); else { if (m%n==0) printf("%d\n",(m/n-1)*n); else { int ans=0; int total=0; int counter=1; int left=0; while (counter<=n) { total=m+left; if (total%n!=0) { ans+=total/n; left=total-total/n*n; } else { ans+=total/n-1; left=0; } counter++; } printf("%d\n",ans); } }}
0 0
- Sicily10330
- ASP.NET页面中获取服务器控件的客户端ID
- mysql workbench建表时PK,NN,UQ,BIN,UN,ZF,AI
- LDA与PCA算法与应用
- 字符串匹配算法——BM算法
- /bin/sh^M: 坏的解释器: 没有那个文件或目录
- Sicily10330
- GStreamer基础教程05——集成GUI工具
- Ajax实现三级联动
- node.js express传递object给ejs(二)
- 第一篇博客
- Android T卡升级时,在recovery模式下升级完成后将手动重启修改为自动重启
- Android.View.InflateException: Binary XML File Line #异常的解决
- 例题2-1 计算圆面积
- C#----对时间结构DateTime的使用(时间日期的使用)